Accordion: Don't change corner classes on the collapsing panel's header until after the animation completes. Fixed #8224 - bug: Accordion corner style applying order.

This commit is contained in:
Scott González 2012-05-08 15:08:05 -04:00
parent fa44e51016
commit 04ba0a254a

View File

@ -410,9 +410,8 @@ $.widget( "ui.accordion", {
this._toggle( eventData ); this._toggle( eventData );
// switch classes // switch classes
active // corner classes on the previously active header stay after the animation
.removeClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) active.removeClass( "ui-accordion-header-active ui-state-active" );
.addClass( "ui-corner-all" );
if ( options.icons ) { if ( options.icons ) {
active.children( ".ui-accordion-header-icon" ) active.children( ".ui-accordion-header-icon" )
.removeClass( options.icons.activeHeader ) .removeClass( options.icons.activeHeader )
@ -518,8 +517,12 @@ $.widget( "ui.accordion", {
_toggleComplete: function( data ) { _toggleComplete: function( data ) {
var toHide = data.oldContent; var toHide = data.oldContent;
// other classes are removed before the animation; this one needs to stay until completed toHide
toHide.removeClass( "ui-accordion-content-active" ); .removeClass( "ui-accordion-content-active" )
.prev()
.removeClass( "ui-corner-top" )
.addClass( "ui-corner-all" );
// Work around for rendering bug in IE (#5421) // Work around for rendering bug in IE (#5421)
if ( toHide.length ) { if ( toHide.length ) {
toHide.parent()[0].className = toHide.parent()[0].className; toHide.parent()[0].className = toHide.parent()[0].className;