diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2015-08-24 08:59:13 -0400 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-09-11 08:29:08 -0400 |
commit | 85ff5205605ad591af9e9848a78334ee44b2284e (patch) | |
tree | f0ada6587dde078d99c20c521819ec6eea599836 /ui | |
parent | a3a847f23a3ab7323df495fa81ad69e0b93196c4 (diff) | |
download | jquery-ui-85ff5205605ad591af9e9848a78334ee44b2284e.tar.gz jquery-ui-85ff5205605ad591af9e9848a78334ee44b2284e.zip |
Menu: Style updates
Ref #14246
Diffstat (limited to 'ui')
-rw-r--r-- | ui/widgets/menu.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/widgets/menu.js b/ui/widgets/menu.js index 48258e85e..f7fa2b651 100644 --- a/ui/widgets/menu.js +++ b/ui/widgets/menu.js @@ -136,6 +136,7 @@ return $.widget( "ui.menu", { mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", focus: function( event, keepActiveItem ) { + // If there's already an active item, keep it active // If not, activate the first item var item = this.active || this.element.find( this.options.items ).eq( 0 ); @@ -475,6 +476,7 @@ return $.widget( "ui.menu", { collapseAll: function( event, all ) { clearTimeout( this.timer ); this.timer = this._delay( function() { + // If we were passed an event, look for the submenu that contains the event var currentMenu = all ? this.element : $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); @@ -633,6 +635,7 @@ return $.widget( "ui.menu", { }, select: function( event ) { + // TODO: It should never be possible to not have an active item at this // point, but the tests don't trigger mouseenter before click. this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); |