aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets/selectmenu.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-09-21 13:01:13 +0200
committerScott González <scott.gonzalez@gmail.com>2015-09-25 13:47:09 -0400
commitd2f62041f97f5cc31f191c4f5e155e336a035878 (patch)
treecb21dbc3dfb9e4cb15b6533545f874922ba5eec2 /ui/widgets/selectmenu.js
parent7ceaa618421dc2be3bdb5f5cf8f62d499e982244 (diff)
downloadjquery-ui-d2f62041f97f5cc31f191c4f5e155e336a035878.tar.gz
jquery-ui-d2f62041f97f5cc31f191c4f5e155e336a035878.zip
Selectmenu: Remove redundant handling of disabled option on create
Ref #9151 Ref gh-1599
Diffstat (limited to 'ui/widgets/selectmenu.js')
-rw-r--r--ui/widgets/selectmenu.js34
1 files changed, 16 insertions, 18 deletions
diff --git a/ui/widgets/selectmenu.js b/ui/widgets/selectmenu.js
index 820e68570..30d8c71af 100644
--- a/ui/widgets/selectmenu.js
+++ b/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;