aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.menubar.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2011-10-09 00:14:03 +0200
committerFelix Nagel <info@felixnagel.com>2011-10-09 00:14:03 +0200
commitac54556fb3b7ab08744cc7ea663a276d5c91cdd4 (patch)
tree22fddadf4753d0e2bce4fc9528b9e1cc7cb342d8 /ui/jquery.ui.menubar.js
parentd7e23ce225b6fe08cfa779df0f7e70e4d95a0883 (diff)
parent647bab506e288658c8a28dab1083c657ad61951e (diff)
downloadjquery-ui-ac54556fb3b7ab08744cc7ea663a276d5c91cdd4.tar.gz
jquery-ui-ac54556fb3b7ab08744cc7ea663a276d5c91cdd4.zip
Merge branch 'master' of github.com:jquery/jquery-ui into selectmenu
Diffstat (limited to 'ui/jquery.ui.menubar.js')
-rw-r--r--ui/jquery.ui.menubar.js30
1 files changed, 12 insertions, 18 deletions
diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js
index 9af3aa080..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 );
@@ -123,22 +123,6 @@ $.widget( "ui.menubar", {
.attr( "aria-haspopup", "true" )
.wrapInner( "<span class='ui-button-text'></span>" );
- 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( "<span class='ui-button-icon-secondary ui-icon ui-icon-triangle-1-s'></span>" );
@@ -166,7 +150,17 @@ $.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 );
}
});
},