]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion demo: Don't use .toggle(fn).
authorScott González <scott.gonzalez@gmail.com>
Mon, 21 May 2012 14:04:23 +0000 (10:04 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 21 May 2012 14:04:23 +0000 (10:04 -0400)
demos/accordion/custom-icons.html

index 54716d9a0ad0b6e5b01af1f25707c5dc99ea3b5d..02344bd125f56b04d446ebe18e34caa10ce9d670 100644 (file)
                $( "#accordion" ).accordion({
                        icons: icons
                });
-               $( "#toggle" ).button().toggle(function() {
-                       $( "#accordion" ).accordion( "option", "icons", null );
-               }, function() {
-                       $( "#accordion" ).accordion( "option", "icons", icons );
+               $( "#toggle" ).button().click(function() {
+                       if ( $( "#accordion" ).accordion( "option", "icons" ) ) {
+                               $( "#accordion" ).accordion( "option", "icons", null );
+                       } else {
+                               $( "#accordion" ).accordion( "option", "icons", icons );
+                       }
                });
        });
        </script>