Skip to content
Permalink
Browse files

Selectmenu: Remove redundant handling of disabled option on create

Ref #9151
Ref gh-1599
  • Loading branch information
jzaefferer authored and scottgonzalez committed Sep 25, 2015
1 parent 7ceaa61 commit d2f62041f97f5cc31f191c4f5e155e336a035878
Showing with 16 additions and 18 deletions.
  1. +16 −18 ui/widgets/selectmenu.js
@@ -79,10 +79,6 @@ return $.widget( "ui.selectmenu", {

this._rendered = false;
this.menuItems = $();

if ( this.options.disabled ) {
this.disable();
}
},

_drawButton: function() {
@@ -562,25 +558,27 @@ return $.widget( "ui.selectmenu", {
this.menuWrap.appendTo( this._appendTo() );
}

if ( key === "disabled" ) {
this.menuInstance.option( "disabled", value );
this.button.attr( "aria-disabled", value );
this._toggleClass( this.button, null, "ui-state-disabled", value );

this.element.prop( "disabled", value );
if ( value ) {
this.button.attr( "tabindex", -1 );
this.close();
} else {
this.button.attr( "tabindex", 0 );
}
}

if ( key === "width" ) {
this._resizeButton();
}
},

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

this.menuInstance.option( "disabled", value );
this.button.attr( "aria-disabled", value );
this._toggleClass( this.button, null, "ui-state-disabled", value );

this.element.prop( "disabled", value );
if ( value ) {
this.button.attr( "tabindex", -1 );
this.close();
} else {
this.button.attr( "tabindex", 0 );
}
},

_appendTo: function() {
var element = this.options.appendTo;

0 comments on commit d2f6204

Please sign in to comment.
You can’t perform that action at this time.