mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Button: Properly handle disabled option on init. Fixes #8028 - Getting unset disabled option on button widget returns jQuery object, not default value.
This commit is contained in:
parent
eee63a2e24
commit
3a1031e58b
8
ui/jquery.ui.button.js
vendored
8
ui/jquery.ui.button.js
vendored
@ -58,7 +58,9 @@ $.widget( "ui.button", {
|
||||
.bind( "reset.button", formResetHandler );
|
||||
|
||||
if ( typeof this.options.disabled !== "boolean" ) {
|
||||
this.options.disabled = this.element.prop( "disabled" );
|
||||
this.options.disabled = !!this.element.prop( "disabled" );
|
||||
} else {
|
||||
this.element.prop( "disabled", this.options.disabled );
|
||||
}
|
||||
|
||||
this._determineButtonType();
|
||||
@ -74,10 +76,6 @@ $.widget( "ui.button", {
|
||||
options.label = this.buttonElement.html();
|
||||
}
|
||||
|
||||
if ( this.element.is( ":disabled" ) ) {
|
||||
options.disabled = true;
|
||||
}
|
||||
|
||||
this.buttonElement
|
||||
.addClass( baseClasses )
|
||||
.attr( "role", "button" )
|
||||
|
Loading…
Reference in New Issue
Block a user