Skip to content

Commit

Permalink
Menu: Remove redundant handling of disabled option on create
Browse files Browse the repository at this point in the history
Ref #9151
Ref gh-1599
  • Loading branch information
jzaefferer authored and scottgonzalez committed Sep 25, 2015
1 parent 83725a8 commit 8d03121
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ui/widgets/menu.js
Expand Up @@ -71,11 +71,6 @@ return $.widget( "ui.menu", {
tabIndex: 0
} );

if ( this.options.disabled ) {
this._addClass( null, "ui-state-disabled" );
this.element.attr( "aria-disabled", "true" );
}

this._addClass( "ui-menu", "ui-widget ui-widget-content" );
this._on( {

Expand Down Expand Up @@ -359,13 +354,16 @@ return $.widget( "ui.menu", {
this._removeClass( icons, null, this.options.icons.submenu )
._addClass( icons, null, value.submenu );
}
if ( key === "disabled" ) {
this.element.attr( "aria-disabled", value );
this._toggleClass( null, "ui-state-disabled", !!value );
}
this._super( key, value );
},

_setOptionDisabled: function( value ) {
this._super( value );

this.element.attr( "aria-disabled", String( value ) );
this._toggleClass( null, "ui-state-disabled", !!value );
},

focus: function( event, item ) {
var nested, focused, activeParent;
this.blur( event, event && event.type === "focus" );
Expand Down

0 comments on commit 8d03121

Please sign in to comment.