diff options
author | Richard Worth <rdworth@gmail.com> | 2009-08-11 00:45:01 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2009-08-11 00:45:01 +0000 |
commit | 7b506cf2aecb8c8988b95b0e59b8593fd1c484bd (patch) | |
tree | c32afd4b90ce41dcd223a246647db7498089666b /ui/ui.accordion.js | |
parent | 57e359511507fd153e0ec72032dafbb62cbf93b4 (diff) | |
download | jquery-ui-7b506cf2aecb8c8988b95b0e59b8593fd1c484bd.tar.gz jquery-ui-7b506cf2aecb8c8988b95b0e59b8593fd1c484bd.zip |
Fixed accordion option active getter and setter. Normalized getter to number, 0-based index.
Diffstat (limited to 'ui/ui.accordion.js')
-rw-r--r-- | ui/ui.accordion.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js index f05a3b1a5..1b8337547 100644 --- a/ui/ui.accordion.js +++ b/ui/ui.accordion.js @@ -153,6 +153,9 @@ $.widget("ui.accordion", { $.widget.prototype._setData.apply(this, arguments); + if (key == "active") { + this.activate(value); + } if (key == "icons") { this._destroyIcons(); if (value) { @@ -230,6 +233,7 @@ $.widget("ui.accordion", { }, activate: function(index) { + this.options.active = index; // call clickHandler with custom event var active = this._findActive(index)[0]; this._clickHandler({ target: active }, active); @@ -273,6 +277,8 @@ $.widget("ui.accordion", { // get the click target var clicked = $(event.currentTarget || target); var clickedIsActive = clicked[0] == this.active[0]; + + o.active = $('.ui-accordion-header', this.element).index(clicked); // if animations are still active, or the active header is the target, ignore click if (this.running || (!o.collapsible && clickedIsActive)) { |