diff options
author | patdenice <patdenice@piwigo.org> | 2011-03-07 00:58:34 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-03-07 00:58:34 +0000 |
commit | ac0ba26afc1fe5f7daf1d7f967301470b461772c (patch) | |
tree | 5da280ad6cbbae4af8498e4e6d2da517c7d1383f /themes/default/js/ui/jquery.ui.button.js | |
parent | d94968f60a8e818fa1c1b18fdc8b83d7affa9b6e (diff) |
Update jQuery UI to 1.8.10.
Improve jquery ui management in template class.
git-svn-id: http://piwigo.org/svn/trunk@9559 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-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( " " ) ); } }); |