]> source.dussan.org Git - jquery-ui.git/commitdiff
Menubar: moved mouseleave _bind call into existing _bind block, added the mouseenter...
authorMarian Rudzynski <mr@impaled.org>
Sat, 1 Oct 2011 14:56:49 +0000 (10:56 -0400)
committerkborchers <kris.borchers@gmail.com>
Sat, 1 Oct 2011 14:56:49 +0000 (10:56 -0400)
ui/jquery.ui.menubar.js

index b86ba298d11f8e3ae3e8f7d607d36c325afbe9b9..673493366d38534d7a6fcf44daf0285265bcd960 100644 (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() {