]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Cleaned up _createIcons().
authorScott González <scott.gonzalez@gmail.com>
Fri, 14 Jan 2011 00:23:55 +0000 (19:23 -0500)
committerScott González <scott.gonzalez@gmail.com>
Fri, 14 Jan 2011 00:23:55 +0000 (19:23 -0500)
ui/jquery.ui.accordion.js

index 58a50692303bb8eb1e3a06ee9371a4b131dc0bae..672d57b87b0659ed8410d3e9f28d87abf448a86d 100644 (file)
@@ -123,14 +123,14 @@ $.widget( "ui.accordion", {
        },
 
        _createIcons: function() {
-               var options = this.options;
-               if ( options.icons ) {
-                       $( "<span></span>" )
-                               .addClass( "ui-icon " + options.icons.header )
+               var icons = this.options.icons;
+               if ( icons ) {
+                       $( "<span>" )
+                               .addClass( "ui-icon " + icons.header )
                                .prependTo( this.headers );
                        this.active.children( ".ui-icon" )
-                               .toggleClass(options.icons.header)
-                               .toggleClass(options.icons.activeHeader);
+                               .removeClass( icons.header )
+                               .addClass( icons.activeHeader );
                        this.element.addClass( "ui-accordion-icons" );
                }
        },