From 44d07173db32b498e5f83f60db290ff1463daee3 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 14 Mar 2013 19:08:21 -0400 Subject: Widget: Stop setting ui-state-disabled and aria by default on setting disabled option. Fixes #5973 - Resizable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #5974 - Draggable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #6039 - Droppable: disabled should not have ui-state-disabled This reverts commit 23771d38ba9d2663f6db0243c8e992dc7ff6844a. --- ui/jquery.ui.button.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index fcb7b14d1..5e64f5164 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -207,9 +207,6 @@ $.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(); }, @@ -273,11 +270,8 @@ $.widget( "ui.button", { _setOption: function( key, value ) { this._super( key, value ); if ( key === "disabled" ) { - if ( value ) { - this.element.prop( "disabled", true ); - } else { - this.element.prop( "disabled", false ); - } + this.widget().toggleClass( "ui-state-disabled", !!value ); + this.element.prop( "disabled", !!value ); return; } this._resetButton(); -- cgit v1.2.3