diff options
Diffstat (limited to 'themes/default/js/ui/jquery.ui.button.js')
-rw-r--r-- | themes/default/js/ui/jquery.ui.button.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/themes/default/js/ui/jquery.ui.button.js b/themes/default/js/ui/jquery.ui.button.js index c53840717..f0a5deca3 100644 --- a/themes/default/js/ui/jquery.ui.button.js +++ b/themes/default/js/ui/jquery.ui.button.js @@ -1,5 +1,5 @@ /* - * jQuery UI Button 1.8.9 + * jQuery UI Button 1.8.10 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. @@ -290,27 +290,32 @@ $.widget( "ui.button", { .appendTo( buttonElement.empty() ) .text(), icons = this.options.icons, - multipleIcons = icons.primary && icons.secondary; + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + if ( icons.primary || icons.secondary ) { - buttonElement.addClass( "ui-button-text-icon" + - ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + 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>" ); } + if ( icons.secondary ) { buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" ); } + if ( !this.options.text ) { - buttonElement - .addClass( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ) - .removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" ); + 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 ); } } } else { - buttonElement.addClass( "ui-button-text-only" ); + buttonClasses.push( "ui-button-text-only" ); } + buttonElement.addClass( buttonClasses.join( " " ) ); } }); |