diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-02-26 11:13:00 +0100 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-02-26 11:15:08 +0100 |
commit | c9bbd9aa6e8bd23e314f4e284aec3b18c6ad797c (patch) | |
tree | ee321995f526c24a13fc4d90276c83feabc7a514 | |
parent | 98513985a27153e54eac5cdccd4643047f88c63a (diff) | |
download | jquery-ui-c9bbd9aa6e8bd23e314f4e284aec3b18c6ad797c.tar.gz jquery-ui-c9bbd9aa6e8bd23e314f4e284aec3b18c6ad797c.zip |
Button: Only add text classes if there is text. Fixes #7040 - button class change breaks icon only buttons.
(cherry picked from commit e72afe4afca0795fc785114cfeafbe08f5e2fdf3)
-rw-r--r-- | ui/jquery.ui.button.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index a32d3991e..fc4c9aa6c 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -294,7 +294,9 @@ $.widget( "ui.button", { buttonClasses = []; if ( icons.primary || icons.secondary ) { - buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + if ( this.options.text ) { + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + } if ( icons.primary ) { buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" ); @@ -306,7 +308,6 @@ $.widget( "ui.button", { if ( !this.options.text ) { buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); - buttonElement.removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" ); if ( !this.hasTitle ) { buttonElement.attr( "title", buttonText ); |