aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-01-18 16:39:41 -0500
committerScott González <scott.gonzalez@gmail.com>2012-01-18 16:39:41 -0500
commitf7f13b5949cd59f4e3f70c315d4e18f9662281ad (patch)
treeda6768f485d537fbb0446c3104ae84dab612c673 /ui
parent94321cae57abbae6ccff1d90a123e5a2fdfd9af2 (diff)
downloadjquery-ui-f7f13b5949cd59f4e3f70c315d4e18f9662281ad.tar.gz
jquery-ui-f7f13b5949cd59f4e3f70c315d4e18f9662281ad.zip
Button: Properly handle disabled option on init. Fixes #8028 - Getting unset disabled option on button widget returns jQuery object, not default value.
(cherry picked from commit 3a1031e58b717b042d39dcccfdbe1d293cdbecf1) Conflicts: ui/jquery.ui.button.js
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.button.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index 31074e2e1..334ff8cbe 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -56,7 +56,9 @@ $.widget( "ui.button", {
.bind( "reset.button", formResetHandler );
if ( typeof this.options.disabled !== "boolean" ) {
- this.options.disabled = this.element.propAttr( "disabled" );
+ this.options.disabled = !!this.element.propAttr( "disabled" );
+ } else {
+ this.element.propAttr( "disabled", this.options.disabled );
}
this._determineButtonType();
@@ -72,10 +74,6 @@ $.widget( "ui.button", {
options.label = this.buttonElement.html();
}
- if ( this.element.is( ":disabled" ) ) {
- options.disabled = true;
- }
-
this.buttonElement
.addClass( baseClasses )
.attr( "role", "button" )