diff options
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r-- | ui/jquery.ui.button.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 5e64f5164..fcb7b14d1 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -207,6 +207,9 @@ $.widget( "ui.button", { } } + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins this._setOption( "disabled", options.disabled ); this._resetButton(); }, @@ -270,8 +273,11 @@ $.widget( "ui.button", { _setOption: function( key, value ) { this._super( key, value ); if ( key === "disabled" ) { - this.widget().toggleClass( "ui-state-disabled", !!value ); - this.element.prop( "disabled", !!value ); + if ( value ) { + this.element.prop( "disabled", true ); + } else { + this.element.prop( "disabled", false ); + } return; } this._resetButton(); |