Skip to content

Commit

Permalink
Accordion: Update active option when programmatically collapsing the …
Browse files Browse the repository at this point in the history
…accordion.
  • Loading branch information
scottgonzalez committed Feb 3, 2011
1 parent d099e3a commit 2e17770
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/unit/accordion/accordion_options.js
Expand Up @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions ui/jquery.ui.accordion.js
Expand Up @@ -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" )
Expand Down

0 comments on commit 2e17770

Please sign in to comment.