|
@ -1191,38 +1191,41 @@ $.fn.dropdown = function(parameters) { |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// left arrow (hide sub-menu)
|
|
|
|
|
|
if(pressedKey == keys.leftArrow) { |
|
|
|
|
|
|
|
|
// sub-menu actions
|
|
|
|
|
|
if(hasSelectedItem) { |
|
|
|
|
|
|
|
|
isSubMenuItem = ($parentMenu[0] !== $menu[0]); |
|
|
|
|
|
|
|
|
if(pressedKey == keys.leftArrow) { |
|
|
|
|
|
|
|
|
if(isSubMenuItem) { |
|
|
|
|
|
module.verbose('Left key pressed, closing sub-menu'); |
|
|
|
|
|
module.animate.hide(false, $parentMenu); |
|
|
|
|
|
$selectedItem |
|
|
|
|
|
.removeClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
$parentMenu |
|
|
|
|
|
.closest(selector.item) |
|
|
|
|
|
.addClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
isSubMenuItem = ($parentMenu[0] !== $menu[0]); |
|
|
|
|
|
|
|
|
|
|
|
if(isSubMenuItem) { |
|
|
|
|
|
module.verbose('Left key pressed, closing sub-menu'); |
|
|
|
|
|
module.animate.hide(false, $parentMenu); |
|
|
|
|
|
$selectedItem |
|
|
|
|
|
.removeClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
$parentMenu |
|
|
|
|
|
.closest(selector.item) |
|
|
|
|
|
.addClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// right arrow (show sub-menu)
|
|
|
|
|
|
if(pressedKey == keys.rightArrow) { |
|
|
|
|
|
if(hasSubMenu) { |
|
|
|
|
|
module.verbose('Right key pressed, opening sub-menu'); |
|
|
|
|
|
module.animate.show(false, $subMenu); |
|
|
|
|
|
$selectedItem |
|
|
|
|
|
.removeClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
$subMenu |
|
|
|
|
|
.find(selector.item).eq(0) |
|
|
|
|
|
.addClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
// right arrow (show sub-menu)
|
|
|
|
|
|
if(pressedKey == keys.rightArrow) { |
|
|
|
|
|
if(hasSubMenu) { |
|
|
|
|
|
module.verbose('Right key pressed, opening sub-menu'); |
|
|
|
|
|
module.animate.show(false, $subMenu); |
|
|
|
|
|
$selectedItem |
|
|
|
|
|
.removeClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
$subMenu |
|
|
|
|
|
.find(selector.item).eq(0) |
|
|
|
|
|
.addClass(className.selected) |
|
|
|
|
|
; |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|