Menubar: moved mouseleave _bind call into existing _bind block, added the mouseenter binding back in to help with accidental quick mouseouts causing the menu to close and use same close time for all

This commit is contained in:
Marian Rudzynski 2011-10-01 10:56:49 -04:00 committed by kborchers
parent 5dcaacca1a
commit 8d09f750a4

View File

@ -94,7 +94,7 @@ $.widget( "ui.menubar", {
}
if ( ( that.open && event.type == "mouseenter" ) || event.type == "click" || that.options.autoExpand ) {
if( that.options.autoExpand ) {
clearTimeout( that.timer );
clearTimeout( that.closeTimer );
}
that._open( event, menu );
@ -150,18 +150,19 @@ $.widget( "ui.menubar", {
focusout: function( event ) {
that.closeTimer = setTimeout( function() {
that._close( event );
}, 100);
}, 150);
},
"mouseleave .ui-menubar-item": function( event ) {
if ( that.options.autoExpand ) {
that.closeTimer = setTimeout( function() {
that._close( event );
}, 150);
}
},
"mouseenter .ui-menubar-item": function( event ) {
clearTimeout( that.closeTimer );
}
});
if ( that.options.autoExpand ) {
that._bind( {
"mouseleave .ui-menubar-item": function( event ) {
that.timer = setTimeout( function() {
that._close();
}, 150 );
}
});
}
},
_destroy : function() {