Menu: Remove the isScrolling check which nolonger seems necessary.

This commit is contained in:
kborchers 2011-11-30 08:39:10 -06:00
parent a3a5c65d4d
commit afdc577e9c

View File

@ -29,7 +29,6 @@ $.widget( "ui.menu", {
}, },
_create: function() { _create: function() {
this.activeMenu = this.element; this.activeMenu = this.element;
this.isScrolling = false;
this.menuId = this.element.attr( "id" ) || "ui-menu-" + idIncrement++; this.menuId = this.element.attr( "id" ) || "ui-menu-" + idIncrement++;
if ( this.element.find( ".ui-icon" ).length ) { if ( this.element.find( ".ui-icon" ).length ) {
this.element.addClass( "ui-menu-icons" ); this.element.addClass( "ui-menu-icons" );
@ -66,13 +65,10 @@ $.widget( "ui.menu", {
}, },
"mouseover .ui-menu-item": function( event ) { "mouseover .ui-menu-item": function( event ) {
event.stopImmediatePropagation(); event.stopImmediatePropagation();
if ( !this.isScrolling ) {
var target = $( event.currentTarget ); var target = $( event.currentTarget );
// Remove ui-state-active class from siblings of the newly focused menu item to avoid a jump caused by adjacent elements both having a class with a border // Remove ui-state-active class from siblings of the newly focused menu item to avoid a jump caused by adjacent elements both having a class with a border
target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" ); target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
this.focus( event, target ); this.focus( event, target );
}
this.isScrolling = false;
}, },
"mouseleave": "collapseAll", "mouseleave": "collapseAll",
"mouseleave .ui-menu": "collapseAll", "mouseleave .ui-menu": "collapseAll",
@ -86,10 +82,6 @@ $.widget( "ui.menu", {
this.collapseAll( event ); this.collapseAll( event );
} }
}, 0); }, 0);
},
scroll: function( event ) {
// Keep track of scrolling to prevent mouseover from firing inadvertently when scrolling the menu
this.isScrolling = true;
} }
}); });