}
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 );
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() {