Skip to content

Commit

Permalink
Accordion: Don't change corner classes on the collapsing panel's head…
Browse files Browse the repository at this point in the history
…er until after the animation completes. Fixed #8224 - bug: Accordion corner style applying order.
  • Loading branch information
scottgonzalez committed May 8, 2012
1 parent fa44e51 commit 04ba0a2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ui/jquery.ui.accordion.js
Expand Up @@ -410,9 +410,8 @@ $.widget( "ui.accordion", {
this._toggle( eventData );

// switch classes
active
.removeClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
.addClass( "ui-corner-all" );
// corner classes on the previously active header stay after the animation
active.removeClass( "ui-accordion-header-active ui-state-active" );
if ( options.icons ) {
active.children( ".ui-accordion-header-icon" )
.removeClass( options.icons.activeHeader )
Expand Down Expand Up @@ -518,8 +517,12 @@ $.widget( "ui.accordion", {
_toggleComplete: function( data ) {
var toHide = data.oldContent;

// other classes are removed before the animation; this one needs to stay until completed
toHide.removeClass( "ui-accordion-content-active" );
toHide
.removeClass( "ui-accordion-content-active" )
.prev()
.removeClass( "ui-corner-top" )
.addClass( "ui-corner-all" );

// Work around for rendering bug in IE (#5421)
if ( toHide.length ) {
toHide.parent()[0].className = toHide.parent()[0].className;
Expand Down

0 comments on commit 04ba0a2

Please sign in to comment.