Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Accordion: Maintain collapsed state on refresh. Fixes #9189 - Accordi…

…on: refresh() method incorrectly opens collapsed accordion.
  • Loading branch information...
commit 5a8596cdf3baa4d835e588cda9060a0537236c71 1 parent 2c43548
@scottgonzalez scottgonzalez authored
View
11 tests/unit/accordion/accordion_methods.js
@@ -35,7 +35,7 @@ test( "enable/disable", function() {
});
test( "refresh", function() {
- expect( 17 );
+ expect( 19 );
var element = $( "#navigation" )
.parent()
.height( 300 )
@@ -109,6 +109,15 @@ test( "refresh", function() {
element.find( "div.foo" ).eq( 0 ).remove();
element.accordion( "refresh" );
state( element, 1 );
+
+ // collapse all panels
+ element.accordion( "option", {
+ collapsible: true,
+ active: false
+ });
+ state( element, 0 );
+ element.accordion( "refresh" );
+ state( element, 0 );
});
test( "widget", function() {
View
2  ui/jquery.ui.accordion.js
@@ -223,7 +223,7 @@ $.widget( "ui.accordion", {
options.active = false;
this.active = $();
// active false only when collapsible is true
- } if ( options.active === false ) {
+ } else if ( options.active === false ) {
this._activate( 0 );
// was active, but active panel is gone
} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {

0 comments on commit 5a8596c

Please sign in to comment.
Something went wrong with that request. Please try again.