From ac8a19b62d89a5b70b8ef89029ff81cdf889cf41 Mon Sep 17 00:00:00 2001 From: kborchers Date: Thu, 29 Sep 2011 14:08:42 -0500 Subject: [PATCH] Menubar: Fixed an issue with autoExpand binding that caused the menu to close on fast mouseenter by changing to _bind on the parent menubar item --- ui/jquery.ui.menubar.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js index 9af3aa080..b86ba298d 100644 --- a/ui/jquery.ui.menubar.js +++ b/ui/jquery.ui.menubar.js @@ -123,22 +123,6 @@ $.widget( "ui.menubar", { .attr( "aria-haspopup", "true" ) .wrapInner( "" ); - if ( that.options.autoExpand ) { - input.bind( "mouseleave.menubar", function( event ) { - that.timer = setTimeout( function() { - that._close(); - }, 150 ); - }); - menu.bind( "mouseleave.menubar", function( event ) { - that.timer = setTimeout( function() { - that._close(); - }, 150 ); - }) - .bind( "mouseenter.menubar", function( event ) { - clearTimeout( that.timer ); - }); - } - // TODO review if these options are a good choice, maybe they can be merged if ( that.options.menuIcon ) { input.addClass( "ui-state-default" ).append( "" ); @@ -169,6 +153,15 @@ $.widget( "ui.menubar", { }, 100); } }); + if ( that.options.autoExpand ) { + that._bind( { + "mouseleave .ui-menubar-item": function( event ) { + that.timer = setTimeout( function() { + that._close(); + }, 150 ); + } + }); + } }, _destroy : function() { -- 2.39.5