aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.button.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-04-29 21:38:23 -0400
committerScott González <scott.gonzalez@gmail.com>2010-04-29 21:38:23 -0400
commit01ad6ce83e7d33c4a51002aa777bd26c39007788 (patch)
tree5974c306c80df43cd9a0f8fa6d233040c35caaa0 /ui/jquery.ui.button.js
parent888725a17b66e73ecfb4716488a14fc5942e7477 (diff)
downloadjquery-ui-01ad6ce83e7d33c4a51002aa777bd26c39007788.tar.gz
jquery-ui-01ad6ce83e7d33c4a51002aa777bd26c39007788.zip
Remove previous text/icon classes when updating buttons.
Fixes #5567 - button text, hide then show again.
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r--ui/jquery.ui.button.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index 4180f3613..83f14f4c9 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -15,8 +15,8 @@
var lastActive,
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
- otherClasses = "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",
+ stateClasses = "ui-state-hover ui-state-active ",
+ typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only",
formResetHandler = function( event ) {
$( ":ui-button", event.target.form ).each(function() {
var inst = $( this ).data( "button" );
@@ -217,7 +217,7 @@ $.widget( "ui.button", {
this.element
.removeClass( "ui-helper-hidden-accessible" );
this.buttonElement
- .removeClass( baseClasses + " " + otherClasses )
+ .removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
.removeAttr( "role" )
.removeAttr( "aria-pressed" )
.html( this.buttonElement.find(".ui-button-text").html() );
@@ -278,7 +278,7 @@ $.widget( "ui.button", {
}
return;
}
- var buttonElement = this.buttonElement,
+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
buttonText = $( "<span></span>" )
.addClass( "ui-button-text" )
.html( this.options.label )