aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMarian Rudzynski <mr@impaled.org>2011-10-01 10:56:49 -0400
committerkborchers <kris.borchers@gmail.com>2011-10-01 10:56:49 -0400
commit8d09f750a45823f7499672076eed5b19a823e309 (patch)
tree7d248e5325f80de165b10cb23490f7dfd555dd17 /ui
parent5dcaacca1a28e846d9d0ba9a8ad73be1c861944f (diff)
downloadjquery-ui-8d09f750a45823f7499672076eed5b19a823e309.tar.gz
jquery-ui-8d09f750a45823f7499672076eed5b19a823e309.zip
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
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.menubar.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js
index b86ba298d..673493366 100644
--- a/ui/jquery.ui.menubar.js
+++ b/ui/jquery.ui.menubar.js
@@ -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() {