diff options
author | gnarf <gnarf@gnarf.net> | 2011-05-01 05:12:17 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-05-01 05:12:17 -0500 |
commit | 4a4d7e4b7392d86944c06e2ec98feef9501f9731 (patch) | |
tree | 4be04eaa5e0cc6229cc16ccfd8235ca061a94c0e /ui/jquery.effects.core.js | |
parent | d6379d11e3c336354b880603b2bfce81ef0b127d (diff) | |
parent | fe3b36b8efcabf3d1f1d60523cae87c69a882f27 (diff) | |
download | jquery-ui-4a4d7e4b7392d86944c06e2ec98feef9501f9731.tar.gz jquery-ui-4a4d7e4b7392d86944c06e2ec98feef9501f9731.zip |
Merge branch 'master' into effects-unit
Diffstat (limited to 'ui/jquery.effects.core.js')
-rw-r--r-- | ui/jquery.effects.core.js | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 573cb2554..581fb0861 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -234,12 +234,12 @@ $.effects.animateClass = function( value, duration, easing, callback ) { easing = null; } - return this.queue( 'fx', function() { + return this.queue(function() { var that = $( this ), originalStyleAttr = that.attr( 'style' ) || ' ', originalStyle = filterStyles( getElementStyles.call( this ) ), newStyle, - className = that.attr( 'className' ); + className = that.attr( 'class' ); $.each( classAnimationActions, function(i, action) { if ( value[ action ] ) { @@ -247,32 +247,31 @@ $.effects.animateClass = function( value, duration, easing, callback ) { } }); newStyle = filterStyles( getElementStyles.call( this ) ); - that.attr( 'className', className ); - - that.animate( styleDifference( originalStyle, newStyle ), duration, easing, function() { - $.each( classAnimationActions, function( i, action ) { - if ( value[ action ] ) { - that[ action + 'Class' ]( value[ action ] ); + that.attr( 'class', className ); + + that.animate( styleDifference( originalStyle, newStyle ), { + queue: false, + duration: duration, + easing: easing, + complete: function() { + $.each( classAnimationActions, function( i, action ) { + if ( value[ action ] ) { + that[ action + 'Class' ]( value[ action ] ); + } + }); + // work around bug in IE by clearing the cssText before setting it + if ( typeof that.attr( 'style' ) == 'object' ) { + that.attr( 'style' ).cssText = ''; + that.attr( 'style' ).cssText = originalStyleAttr; + } else { + that.attr( 'style', originalStyleAttr ); } - }); - // work around bug in IE by clearing the cssText before setting it - if ( typeof that.attr( 'style' ) == 'object' ) { - that.attr( 'style' ).cssText = ''; - that.attr( 'style' ).cssText = originalStyleAttr; - } else { - that.attr( 'style', originalStyleAttr ); - } - if ( callback ) { - callback.apply( this, arguments ); + if ( callback ) { + callback.apply( this, arguments ); + } + $.dequeue( this ); } }); - - // $.animate adds a function to the end of the queue - // but we want it at the front - var queue = $.queue( this ), - anim = queue.splice( queue.length - 1, 1 )[ 0 ]; - queue.splice( 1, 0, anim ); - $.dequeue( this ); }); }; |