From 85ff5205605ad591af9e9848a78334ee44b2284e Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Mon, 24 Aug 2015 08:59:13 -0400 Subject: Menu: Style updates Ref #14246 --- ui/widgets/menu.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ui') 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" ); -- cgit v1.2.3