Skip to content

Commit 8d03121

Browse files
jzaeffererscottgonzalez
authored andcommitted
Menu: Remove redundant handling of disabled option on create
Ref #9151 Ref gh-1599
1 parent 83725a8 commit 8d03121

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

ui/widgets/menu.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ return $.widget( "ui.menu", {
7171
tabIndex: 0
7272
} );
7373

74-
if ( this.options.disabled ) {
75-
this._addClass( null, "ui-state-disabled" );
76-
this.element.attr( "aria-disabled", "true" );
77-
}
78-
7974
this._addClass( "ui-menu", "ui-widget ui-widget-content" );
8075
this._on( {
8176

@@ -359,13 +354,16 @@ return $.widget( "ui.menu", {
359354
this._removeClass( icons, null, this.options.icons.submenu )
360355
._addClass( icons, null, value.submenu );
361356
}
362-
if ( key === "disabled" ) {
363-
this.element.attr( "aria-disabled", value );
364-
this._toggleClass( null, "ui-state-disabled", !!value );
365-
}
366357
this._super( key, value );
367358
},
368359

360+
_setOptionDisabled: function( value ) {
361+
this._super( value );
362+
363+
this.element.attr( "aria-disabled", String( value ) );
364+
this._toggleClass( null, "ui-state-disabled", !!value );
365+
},
366+
369367
focus: function( event, item ) {
370368
var nested, focused, activeParent;
371369
this.blur( event, event && event.type === "focus" );

0 commit comments

Comments
 (0)