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:14:15 +0100 |
commit | e72afe4afca0795fc785114cfeafbe08f5e2fdf3 (patch) | |
tree | 5f1bda7578a2092aa083a2e22f2c6034f5ed7760 /ui/jquery.ui.button.js | |
parent | 260a6447d38d0aa284443fbe245b634355112f8c (diff) | |
download | jquery-ui-e72afe4afca0795fc785114cfeafbe08f5e2fdf3.tar.gz jquery-ui-e72afe4afca0795fc785114cfeafbe08f5e2fdf3.zip |
Button: Only add text classes if there is text. Fixes #7040 - button class change breaks icon only buttons.
Diffstat (limited to 'ui/jquery.ui.button.js')
-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 d2458aa3c..134dae3d3 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -293,7 +293,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>" ); @@ -305,7 +307,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 ); |