aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.accordion.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-02-03 09:54:11 -0500
committerScott González <scott.gonzalez@gmail.com>2011-02-03 09:54:11 -0500
commit714a77f202ee02b894992722d2e6b35b4089557e (patch)
tree9f1923c4bdf769801426231ac44aca342d755972 /ui/jquery.ui.accordion.js
parent39cf7d5bb4f9dfe1ada5dc2499f5c91e536ec96b (diff)
downloadjquery-ui-714a77f202ee02b894992722d2e6b35b4089557e.tar.gz
jquery-ui-714a77f202ee02b894992722d2e6b35b4089557e.zip
Accordion: Properly handle collapsible: false and active: false by changing active to 0.
Diffstat (limited to 'ui/jquery.ui.accordion.js')
-rw-r--r--ui/jquery.ui.accordion.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 4357c435b..33c3a8505 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -44,6 +44,10 @@ $.widget( "ui.accordion", {
self.headers.next()
.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );
+ // don't allow collapsible: false and active: false
+ if ( !options.collapsible && options.active === false ) {
+ options.active = 0;
+ }
self.active = self._findActive( options.active )
.addClass( "ui-state-default ui-state-active" )
.toggleClass( "ui-corner-all" )
@@ -149,12 +153,18 @@ $.widget( "ui.accordion", {
this._super( "_setOption", key, value );
+ // setting collapsible: false while collapsed; open first panel
+ if ( key === "collapsible" && !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+
if ( key === "icons" ) {
this._destroyIcons();
if ( value ) {
this._createIcons();
}
}
+
// #5332 - opacity doesn't cascade to positioned elements in IE
// so we need to add the disabled class to the headers and panels
if ( key === "disabled" ) {