mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: handle active: null. Fixes #8694: 1.9 Accordion - active: null allows panels to be collapsible.
This commit is contained in:
parent
390510c705
commit
c2802d7aa0
@ -13,6 +13,15 @@ test( "{ active: default }", function() {
|
||||
state( element, 1, 0, 0 );
|
||||
});
|
||||
|
||||
test( "{ active: null }", function() {
|
||||
expect( 2 );
|
||||
var element = $( "#list1" ).accordion({
|
||||
active: null
|
||||
});
|
||||
equal( element.accordion( "option", "active" ), 0 );
|
||||
state( element, 1, 0, 0 );
|
||||
});
|
||||
|
||||
test( "{ active: false }", function() {
|
||||
expect( 7 );
|
||||
var element = $( "#list1" ).accordion({
|
||||
|
4
ui/jquery.ui.accordion.js
vendored
4
ui/jquery.ui.accordion.js
vendored
@ -59,8 +59,8 @@ $.widget( "ui.accordion", {
|
||||
.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
|
||||
.hide();
|
||||
|
||||
// don't allow collapsible: false and active: false
|
||||
if ( !options.collapsible && options.active === false ) {
|
||||
// don't allow collapsible: false and active: false / null
|
||||
if ( !options.collapsible && ( !options.active || typeof options.active !== "number" ) ) {
|
||||
options.active = 0;
|
||||
}
|
||||
// handle negative values
|
||||
|
Loading…
Reference in New Issue
Block a user