mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: Maintain collapsed state on refresh. Fixes #9189 - Accordion: refresh() method incorrectly opens collapsed accordion.
(cherry picked from commit 5a8596cdf3
)
This commit is contained in:
parent
f9097a6d86
commit
a93ad182c8
@ -30,7 +30,7 @@ test( "enable/disable", function() {
|
||||
});
|
||||
|
||||
test( "refresh", function() {
|
||||
expect( 17 );
|
||||
expect( 19 );
|
||||
var element = $( "#navigation" )
|
||||
.parent()
|
||||
.height( 300 )
|
||||
@ -104,6 +104,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() {
|
||||
|
2
ui/jquery.ui.accordion.js
vendored
2
ui/jquery.ui.accordion.js
vendored
@ -221,7 +221,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 ] ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user