Last active
August 29, 2015 14:08
-
-
Save randombrad/eff4ef8034d88cce1bb8 to your computer and use it in GitHub Desktop.
Additional Code to Force Dropdown display on click and mouseleave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUI.add( | |
'liferay-navigation-interaction-click', | |
function(A) { | |
A.mix( | |
Liferay.NavigationInteraction.prototype, | |
{ | |
_initChildMenuHandlers: function(navigation) { | |
var instance = this; | |
if (navigation) { | |
navigation.delegate(['click', 'clickoutside'], instance._onMouseToggle, '> li', instance); | |
navigation.delegate('keydown', instance._handleKeyDown, 'a', instance); | |
} | |
}, | |
_onMouseToggle: function(event) { | |
var instance = this; | |
var mapHover = instance.MAP_HOVER; | |
var eventType = 'hideNavigationMenu'; | |
if (event.type == 'click') { | |
eventType = 'showNavigationMenu'; | |
} | |
mapHover.menu = event.currentTarget; | |
Liferay.fire(eventType, mapHover); | |
}, | |
}, | |
true | |
); | |
}, | |
'', | |
{ | |
requires: ['event-click', 'event-outside', 'liferay-navigation-interaction'] | |
} | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment