]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Update active option when programmatically collapsing the accordion.
authorScott González <scott.gonzalez@gmail.com>
Thu, 3 Feb 2011 15:04:40 +0000 (10:04 -0500)
committerScott González <scott.gonzalez@gmail.com>
Thu, 3 Feb 2011 15:04:40 +0000 (10:04 -0500)
tests/unit/accordion/accordion_options.js
ui/jquery.ui.accordion.js

index 9aa7e6e76c4ddfddf4ae3fd764cbc6c472e67a38..d5a8194da14ac788b2132f85412dd8acbc2d22f7 100644 (file)
@@ -92,10 +92,9 @@ test( "{ collapsible: true }", function() {
                collapsible: true
        });
 
-       // TODO: fix setting active to false
-//     ac.accordion( "option", "active", false );
-//     equal( ac.accordion( "option", "active" ), false );
-//     state( ac, 0, 0, 0 );
+       ac.accordion( "option", "active", false );
+       equal( ac.accordion( "option", "active" ), false );
+       state( ac, 0, 0, 0 );
 
        ac.accordion( "option", "active", 1 );
        equal( ac.accordion( "option", "active" ), 1 );
index 71e3b44b4486ed93ecfd6320bd36c03c693f3fcc..4409c572c5ed2c94cf9fb94c7b1939d52172dacd 100644 (file)
@@ -285,6 +285,7 @@ $.widget( "ui.accordion", {
                        return;
                }
 
+               this.options.active = false;
                this.active
                        .removeClass( "ui-state-active ui-corner-top" )
                        .addClass( "ui-state-default ui-corner-all" )