|
@ -324,8 +324,8 @@ $.fn.dropdown = function(parameters) { |
|
|
module.set.multiple(); |
|
|
module.set.multiple(); |
|
|
} |
|
|
} |
|
|
if ($input.prop('disabled')) { |
|
|
if ($input.prop('disabled')) { |
|
|
module.debug('Disabling dropdown') |
|
|
|
|
|
$module.addClass(className.disabled) |
|
|
|
|
|
|
|
|
module.debug('Disabling dropdown'); |
|
|
|
|
|
$module.addClass(className.disabled); |
|
|
} |
|
|
} |
|
|
$input |
|
|
$input |
|
|
.removeAttr('class') |
|
|
.removeAttr('class') |
|
@ -970,17 +970,20 @@ $.fn.dropdown = function(parameters) { |
|
|
item: { |
|
|
item: { |
|
|
mouseenter: function(event) { |
|
|
mouseenter: function(event) { |
|
|
var |
|
|
var |
|
|
$subMenu = $(this).children(selector.menu), |
|
|
|
|
|
$otherMenus = $(this).siblings(selector.item).children(selector.menu) |
|
|
|
|
|
|
|
|
$target = $(event.target), |
|
|
|
|
|
$subMenu = $(this).children(selector.menu), |
|
|
|
|
|
$otherMenus = $(this).siblings(selector.item).children(selector.menu), |
|
|
|
|
|
hasSubMenu = ($subMenu.length > 0), |
|
|
|
|
|
isBubbledEvent = ($subMenu.find($target).length > 0) |
|
|
; |
|
|
; |
|
|
if( $subMenu.length > 0 ) { |
|
|
|
|
|
|
|
|
if( !isBubbledEvent && hasSubMenu ) { |
|
|
clearTimeout(module.itemTimer); |
|
|
clearTimeout(module.itemTimer); |
|
|
module.itemTimer = setTimeout(function() { |
|
|
module.itemTimer = setTimeout(function() { |
|
|
module.verbose('Showing sub-menu', $subMenu); |
|
|
module.verbose('Showing sub-menu', $subMenu); |
|
|
$.each($otherMenus, function() { |
|
|
$.each($otherMenus, function() { |
|
|
module.animate.hide(false, $(this)); |
|
|
module.animate.hide(false, $(this)); |
|
|
}); |
|
|
}); |
|
|
module.animate.show(false, $subMenu); |
|
|
|
|
|
|
|
|
module.animate.show(false, $subMenu); |
|
|
}, settings.delay.show); |
|
|
}, settings.delay.show); |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
} |
|
|
} |
|
@ -993,7 +996,7 @@ $.fn.dropdown = function(parameters) { |
|
|
clearTimeout(module.itemTimer); |
|
|
clearTimeout(module.itemTimer); |
|
|
module.itemTimer = setTimeout(function() { |
|
|
module.itemTimer = setTimeout(function() { |
|
|
module.verbose('Hiding sub-menu', $subMenu); |
|
|
module.verbose('Hiding sub-menu', $subMenu); |
|
|
module.animate.hide(false, $subMenu); |
|
|
|
|
|
|
|
|
module.animate.hide(false, $subMenu); |
|
|
}, settings.delay.hide); |
|
|
}, settings.delay.hide); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -1189,7 +1192,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
|
|
|
|
|
if(isSubMenuItem) { |
|
|
if(isSubMenuItem) { |
|
|
module.verbose('Left key pressed, closing sub-menu'); |
|
|
module.verbose('Left key pressed, closing sub-menu'); |
|
|
module.animate.hide(false, $parentMenu); |
|
|
|
|
|
|
|
|
module.animate.hide(false, $parentMenu); |
|
|
$selectedItem |
|
|
$selectedItem |
|
|
.removeClass(className.selected) |
|
|
.removeClass(className.selected) |
|
|
; |
|
|
; |
|
@ -1205,7 +1208,7 @@ $.fn.dropdown = function(parameters) { |
|
|
if(pressedKey == keys.rightArrow) { |
|
|
if(pressedKey == keys.rightArrow) { |
|
|
if(hasSubMenu) { |
|
|
if(hasSubMenu) { |
|
|
module.verbose('Right key pressed, opening sub-menu'); |
|
|
module.verbose('Right key pressed, opening sub-menu'); |
|
|
module.animate.show(false, $subMenu); |
|
|
|
|
|
|
|
|
module.animate.show(false, $subMenu); |
|
|
$selectedItem |
|
|
$selectedItem |
|
|
.removeClass(className.selected) |
|
|
.removeClass(className.selected) |
|
|
; |
|
|
; |
|
|