diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-02-03 09:59:05 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-02-03 09:59:05 -0500 |
commit | d099e3a3b2645ed1c6b0da8a654553970be7140c (patch) | |
tree | 9ed1d7038bd4ecefbce7bf926ef6bf256ac532e7 /ui | |
parent | 714a77f202ee02b894992722d2e6b35b4089557e (diff) | |
download | jquery-ui-d099e3a3b2645ed1c6b0da8a654553970be7140c.tar.gz jquery-ui-d099e3a3b2645ed1c6b0da8a654553970be7140c.zip |
Accordion: Handle negative values for active option on init.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.accordion.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 33c3a8505..71e3b44b4 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -48,6 +48,10 @@ $.widget( "ui.accordion", { if ( !options.collapsible && options.active === false ) { options.active = 0; } + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } self.active = self._findActive( options.active ) .addClass( "ui-state-default ui-state-active" ) .toggleClass( "ui-corner-all" ) |