diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-09-21 13:20:09 +0200 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-09-25 13:47:14 -0400 |
commit | 1397ce4df68e65cb4d417e34e12f13908798234c (patch) | |
tree | dfe7d995bd7ba174e7e62eb0b128df819a5111f3 /ui | |
parent | 897dc718c61fdfe3c40c9a8b24c89128bbfe13aa (diff) | |
download | jquery-ui-1397ce4df68e65cb4d417e34e12f13908798234c.tar.gz jquery-ui-1397ce4df68e65cb4d417e34e12f13908798234c.zip |
Spinner: Remove redundant handling of disabled option on create
Ref #9151
Ref gh-1599
Diffstat (limited to 'ui')
-rw-r--r-- | ui/widgets/spinner.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/ui/widgets/spinner.js b/ui/widgets/spinner.js index 369e29bd7..f79b2baed 100644 --- a/ui/widgets/spinner.js +++ b/ui/widgets/spinner.js @@ -268,11 +268,6 @@ $.widget( "ui.spinner", { this.uiSpinner.height() > 0 ) { this.uiSpinner.height( this.uiSpinner.height() ); } - - // Disable spinner if element was already disabled - if ( this.options.disabled ) { - this.disable(); - } }, _keydown: function( event ) { @@ -427,12 +422,14 @@ $.widget( "ui.spinner", { } this._super( key, value ); + }, - if ( key === "disabled" ) { - this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value ); - this.element.prop( "disabled", !!value ); - this.buttons.button( value ? "disable" : "enable" ); - } + _setOptionDisabled: function( value ) { + this._super( value ); + + this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value ); + this.element.prop( "disabled", !!value ); + this.buttons.button( value ? "disable" : "enable" ); }, _setOptions: spinnerModifer( function( options ) { |