// adjust menu styles to dropdown
this.menu.addClass( "ui-corner-bottom" ).removeClass( "ui-corner-all" );
- // Make sure focus stays on selected item
- this.menuInstance.delay = 999999999;
// Unbind uneeded Menu events
this.menuInstance._off( this.menu, "mouseleave" );
+
+ // Cancel the menu's collapseAll on document click
+ this.menuInstance._closeOnDocumentClick = function() {
+ return false;
+ };
},
refresh: function() {
if ( this.options.disabled ) {
return;
}
+
// Support: IE6-IE9 click doesn't trigger focus on the button
if ( !this.menuItems ) {
this.refresh();
+ } else {
+ this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
+ this.menu.menu( "focus", null, this._getSelectedItem() );
}
this.isOpen = true;
this._trigger( "open", event );
},
-
+
_position: function() {
this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
},