aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-01-11 13:20:50 -0500
committerScott González <scott.gonzalez@gmail.com>2011-01-11 13:20:50 -0500
commitdd89ea5ff30a87d756453a73651cd30ae658492a (patch)
tree83f4468fc971ef95f9146530ec2f030a751f3219 /ui
parent723e0d6b6ebaecdf39a22aa204277cd630f79e93 (diff)
downloadjquery-ui-dd89ea5ff30a87d756453a73651cd30ae658492a.tar.gz
jquery-ui-dd89ea5ff30a87d756453a73651cd30ae658492a.zip
Accordion: Start the accordion animation before changing classes. Fixes #6720 - Accordion: ol numbering bug.
Thanks Tony Ross.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.accordion.js35
1 files changed, 19 insertions, 16 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 955030ccc..064d8dc91 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -338,8 +338,26 @@ $.widget( "ui.accordion", {
return;
}
+ // find elements to show and hide
+ var active = this.active,
+ toShow = clicked.next(),
+ toHide = this.active.next(),
+ data = {
+ options: options,
+ newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
+ oldHeader: this.active,
+ newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
+ oldContent: toHide
+ },
+ down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
+
+ // when the call to ._toggle() comes after the class changes
+ // it causes a very odd bug in IE 8 (see #6720)
+ this.active = clickedIsActive ? $([]) : clicked;
+ this._toggle( toShow, toHide, data, clickedIsActive, down );
+
// switch classes
- this.active
+ active
.removeClass( "ui-state-active ui-corner-top" )
.addClass( "ui-state-default ui-corner-all" )
.children( ".ui-icon" )
@@ -357,21 +375,6 @@ $.widget( "ui.accordion", {
.addClass( "ui-accordion-content-active" );
}
- // find elements to show and hide
- var toShow = clicked.next(),
- toHide = this.active.next(),
- data = {
- options: options,
- newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
- oldHeader: this.active,
- newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
- oldContent: toHide
- },
- down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
-
- this.active = clickedIsActive ? $([]) : clicked;
- this._toggle( toShow, toHide, data, clickedIsActive, down );
-
return;
},