|
@ -6630,12 +6630,6 @@ $.fn.dropdown = function(parameters) { |
|
|
else { |
|
|
else { |
|
|
module.set.upward($menu); |
|
|
module.set.upward($menu); |
|
|
} |
|
|
} |
|
|
if(module.is.fitWidth($menu)) { |
|
|
|
|
|
module.remove.leftward($menu); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.set.leftward($menu); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
else if(settings.direction == 'upward') { |
|
|
else if(settings.direction == 'upward') { |
|
|
module.set.upward($menu); |
|
|
module.set.upward($menu); |
|
@ -6645,14 +6639,6 @@ $.fn.dropdown = function(parameters) { |
|
|
var $element = $menu || $module; |
|
|
var $element = $menu || $module; |
|
|
$element.addClass(className.upward); |
|
|
$element.addClass(className.upward); |
|
|
}, |
|
|
}, |
|
|
leftward: function($menu) { |
|
|
|
|
|
var $element = $menu || $module; |
|
|
|
|
|
var parentMenu = $element.parent().closest(selector.menu); |
|
|
|
|
|
if (parentMenu.hasClass('transition')) { |
|
|
|
|
|
$element = parentMenu; |
|
|
|
|
|
} |
|
|
|
|
|
$element.addClass(className.leftward); |
|
|
|
|
|
}, |
|
|
|
|
|
value: function(value, text, $selected) { |
|
|
value: function(value, text, $selected) { |
|
|
var |
|
|
var |
|
|
escapedValue = module.escape.value(value), |
|
|
escapedValue = module.escape.value(value), |
|
@ -7004,14 +6990,6 @@ $.fn.dropdown = function(parameters) { |
|
|
var $element = $menu || $module; |
|
|
var $element = $menu || $module; |
|
|
$element.removeClass(className.upward); |
|
|
$element.removeClass(className.upward); |
|
|
}, |
|
|
}, |
|
|
leftward: function($menu) { |
|
|
|
|
|
var $element = $menu || $module; |
|
|
|
|
|
var parentMenu = $element.parent().closest(selector.menu); |
|
|
|
|
|
if (parentMenu.hasClass('transition')) { |
|
|
|
|
|
$element = parentMenu; |
|
|
|
|
|
} |
|
|
|
|
|
$element.removeClass(className.leftward); |
|
|
|
|
|
}, |
|
|
|
|
|
visible: function() { |
|
|
visible: function() { |
|
|
$module.removeClass(className.visible); |
|
|
$module.removeClass(className.visible); |
|
|
}, |
|
|
}, |
|
@ -7374,34 +7352,6 @@ $.fn.dropdown = function(parameters) { |
|
|
$currentMenu.removeClass(className.loading); |
|
|
$currentMenu.removeClass(className.loading); |
|
|
return canOpenDownward; |
|
|
return canOpenDownward; |
|
|
}, |
|
|
}, |
|
|
fitWidth: function($subMenu) { |
|
|
|
|
|
var |
|
|
|
|
|
$currentMenu = $subMenu || $menu, |
|
|
|
|
|
canOpenRightward = true, |
|
|
|
|
|
isOutsideScreen = false, |
|
|
|
|
|
calculations |
|
|
|
|
|
; |
|
|
|
|
|
$currentMenu.addClass(className.loading); |
|
|
|
|
|
calculations = { |
|
|
|
|
|
childrenWidth: 0, |
|
|
|
|
|
contextWidth: $context.outerWidth(), |
|
|
|
|
|
menuOffset : $currentMenu.offset().left, |
|
|
|
|
|
menuWidth : $currentMenu.outerWidth() |
|
|
|
|
|
}; |
|
|
|
|
|
$currentMenu.find(selector.menu).each(function() { |
|
|
|
|
|
var child = $(this); |
|
|
|
|
|
child.show(); |
|
|
|
|
|
calculations.childrenWidth += child[0].offsetWidth; |
|
|
|
|
|
}); |
|
|
|
|
|
isOutsideScreen = ((calculations.contextWidth < calculations.menuOffset + calculations.menuWidth + calculations.childrenWidth) || (calculations.menuOffset - $menu.offset().left < 0)); |
|
|
|
|
|
|
|
|
|
|
|
if(isOutsideScreen) { |
|
|
|
|
|
module.verbose('Dropdown cannot fit in context rightward', isOutsideScreen); |
|
|
|
|
|
canOpenRightward = false; |
|
|
|
|
|
} |
|
|
|
|
|
$currentMenu.removeClass(className.loading); |
|
|
|
|
|
return canOpenRightward; |
|
|
|
|
|
}, |
|
|
|
|
|
inObject: function(needle, object) { |
|
|
inObject: function(needle, object) { |
|
|
var |
|
|
var |
|
|
found = false |
|
|
found = false |
|
@ -7582,12 +7532,7 @@ $.fn.dropdown = function(parameters) { |
|
|
onStart : start, |
|
|
onStart : start, |
|
|
onComplete : function() { |
|
|
onComplete : function() { |
|
|
if(settings.direction == 'auto') { |
|
|
if(settings.direction == 'auto') { |
|
|
if ($currentMenu.hasClass(className.leftward)) { |
|
|
|
|
|
module.remove.leftward($subMenu); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.remove.upward($subMenu); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
module.remove.upward($subMenu); |
|
|
} |
|
|
} |
|
|
callback.call(element); |
|
|
callback.call(element); |
|
|
} |
|
|
} |
|
@ -8018,7 +7963,6 @@ $.fn.dropdown.settings = { |
|
|
selected : 'selected', |
|
|
selected : 'selected', |
|
|
selection : 'selection', |
|
|
selection : 'selection', |
|
|
upward : 'upward', |
|
|
upward : 'upward', |
|
|
leftward : 'left', |
|
|
|
|
|
visible : 'visible' |
|
|
visible : 'visible' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|