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.
(cherry picked from commit 3a1031e58b
)
Conflicts:
ui/jquery.ui.button.js
This commit is contained in:
parent
94321cae57
commit
f7f13b5949
8
ui/jquery.ui.button.js
vendored
8
ui/jquery.ui.button.js
vendored
@ -56,7 +56,9 @@ $.widget( "ui.button", {
|
|||||||
.bind( "reset.button", formResetHandler );
|
.bind( "reset.button", formResetHandler );
|
||||||
|
|
||||||
if ( typeof this.options.disabled !== "boolean" ) {
|
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();
|
this._determineButtonType();
|
||||||
@ -72,10 +74,6 @@ $.widget( "ui.button", {
|
|||||||
options.label = this.buttonElement.html();
|
options.label = this.buttonElement.html();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.element.is( ":disabled" ) ) {
|
|
||||||
options.disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.buttonElement
|
this.buttonElement
|
||||||
.addClass( baseClasses )
|
.addClass( baseClasses )
|
||||||
.attr( "role", "button" )
|
.attr( "role", "button" )
|
||||||
|
Loading…
Reference in New Issue
Block a user