mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Remove previous text/icon classes when updating buttons.
Fixes #5567 - button text, hide then show again.
This commit is contained in:
parent
888725a17b
commit
01ad6ce83e
8
ui/jquery.ui.button.js
vendored
8
ui/jquery.ui.button.js
vendored
@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
var lastActive,
|
var lastActive,
|
||||||
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
|
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
|
||||||
otherClasses = "ui-state-hover ui-state-active " +
|
stateClasses = "ui-state-hover ui-state-active ",
|
||||||
"ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only",
|
typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only",
|
||||||
formResetHandler = function( event ) {
|
formResetHandler = function( event ) {
|
||||||
$( ":ui-button", event.target.form ).each(function() {
|
$( ":ui-button", event.target.form ).each(function() {
|
||||||
var inst = $( this ).data( "button" );
|
var inst = $( this ).data( "button" );
|
||||||
@ -217,7 +217,7 @@ $.widget( "ui.button", {
|
|||||||
this.element
|
this.element
|
||||||
.removeClass( "ui-helper-hidden-accessible" );
|
.removeClass( "ui-helper-hidden-accessible" );
|
||||||
this.buttonElement
|
this.buttonElement
|
||||||
.removeClass( baseClasses + " " + otherClasses )
|
.removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
|
||||||
.removeAttr( "role" )
|
.removeAttr( "role" )
|
||||||
.removeAttr( "aria-pressed" )
|
.removeAttr( "aria-pressed" )
|
||||||
.html( this.buttonElement.find(".ui-button-text").html() );
|
.html( this.buttonElement.find(".ui-button-text").html() );
|
||||||
@ -278,7 +278,7 @@ $.widget( "ui.button", {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var buttonElement = this.buttonElement,
|
var buttonElement = this.buttonElement.removeClass( typeClasses ),
|
||||||
buttonText = $( "<span></span>" )
|
buttonText = $( "<span></span>" )
|
||||||
.addClass( "ui-button-text" )
|
.addClass( "ui-button-text" )
|
||||||
.html( this.options.label )
|
.html( this.options.label )
|
||||||
|
Loading…
Reference in New Issue
Block a user