mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
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:
parent
5dcaacca1a
commit
8d09f750a4
23
ui/jquery.ui.menubar.js
vendored
23
ui/jquery.ui.menubar.js
vendored
@ -94,7 +94,7 @@ $.widget( "ui.menubar", {
|
|||||||
}
|
}
|
||||||
if ( ( that.open && event.type == "mouseenter" ) || event.type == "click" || that.options.autoExpand ) {
|
if ( ( that.open && event.type == "mouseenter" ) || event.type == "click" || that.options.autoExpand ) {
|
||||||
if( that.options.autoExpand ) {
|
if( that.options.autoExpand ) {
|
||||||
clearTimeout( that.timer );
|
clearTimeout( that.closeTimer );
|
||||||
}
|
}
|
||||||
|
|
||||||
that._open( event, menu );
|
that._open( event, menu );
|
||||||
@ -150,18 +150,19 @@ $.widget( "ui.menubar", {
|
|||||||
focusout: function( event ) {
|
focusout: function( event ) {
|
||||||
that.closeTimer = setTimeout( function() {
|
that.closeTimer = setTimeout( function() {
|
||||||
that._close( event );
|
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() {
|
_destroy : function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user