]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Don't toggle icons if the accordion doesn't have icons.
authorScott González <scott.gonzalez@gmail.com>
Mon, 27 Feb 2012 02:54:05 +0000 (21:54 -0500)
committerScott González <scott.gonzalez@gmail.com>
Mon, 27 Feb 2012 02:54:05 +0000 (21:54 -0500)
ui/jquery.ui.accordion.js

index 8731c17cac11b0f50922f04fb2816ccb1922da89..00acf2d1028404f87a7982d3eed5c856c3f9f618 100644 (file)
@@ -347,17 +347,23 @@ $.widget( "ui.accordion", {
                // switch classes
                active
                        .removeClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
-                       .addClass( "ui-corner-all" )
-                       .children( ".ui-accordion-header-icon" )
+                       .addClass( "ui-corner-all" );
+               if ( options.icons ) {
+                       active.children( ".ui-accordion-header-icon" )
                                .removeClass( options.icons.activeHeader )
                                .addClass( options.icons.header );
+               }
+
                if ( !clickedIsActive ) {
                        clicked
                                .removeClass( "ui-corner-all" )
-                               .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
-                               .children( ".ui-accordion-header-icon" )
+                               .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
+                       if ( options.icons ) {
+                               clicked.children( ".ui-accordion-header-icon" )
                                        .removeClass( options.icons.header )
                                        .addClass( options.icons.activeHeader );
+                       }
+
                        clicked
                                .next()
                                .addClass( "ui-accordion-content-active" );