Fix for #1823 bug in animate {queue:false} plus a unit test.
[jquery.git] / src / fx.js
index a143df6..4ccb089 100644 (file)
--- a/src/fx.js
+++ b/src/fx.js
@@ -66,10 +66,10 @@ jQuery.fn.extend({
        },
        
        animate: function( prop, speed, easing, callback ) {
-               var opt = jQuery.speed(speed, easing, callback);
+               var optall = jQuery.speed(speed, easing, callback);
 
-               return this[ opt.queue === false ? "each" : "queue" ](function(){
-                       opt = jQuery.extend({}, opt);
+               return this[ optall.queue === false ? "each" : "queue" ](function(){
+                       var opt = jQuery.extend({}, optall);
                        var hidden = jQuery(this).is(":hidden"), self = this;
                        
                        for ( var p in prop ) {
@@ -201,7 +201,8 @@ jQuery.extend({
                // Queueing
                opt.old = opt.complete;
                opt.complete = function(){
-                       jQuery(this).dequeue();
+                       if ( opt.queue !== false )
+                               jQuery(this).dequeue();
                        if ( jQuery.isFunction( opt.old ) )
                                opt.old.apply( this );
                };