Skip to content

Commit

Permalink
Button: Properly handle disabled option on init. Fixes #8028 - Gettin…
Browse files Browse the repository at this point in the history
…g unset disabled option on button widget returns jQuery object, not default value.

(cherry picked from commit 3a1031e)

Conflicts:

	ui/jquery.ui.button.js
  • Loading branch information
scottgonzalez committed Jan 18, 2012
1 parent 94321ca commit f7f13b5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ui/jquery.ui.button.js
Expand Up @@ -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();
Expand All @@ -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" )
Expand Down

0 comments on commit f7f13b5

Please sign in to comment.