From: Corey Frang Date: Mon, 10 Oct 2011 18:51:59 +0000 (-0500) Subject: .stop( [queue,] clearQueue, gotoEnd ) X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fdd60f8705e98430df62196f505cb929b2d7f6bc;p=jquery.git .stop( [queue,] clearQueue, gotoEnd ) --- diff --git a/src/effects.js b/src/effects.js index 147763d63..9be9293e5 100644 --- a/src/effects.js +++ b/src/effects.js @@ -248,7 +248,12 @@ jQuery.fn.extend({ this.queue( optall.queue, doAnimation ); }, - stop: function( clearQueue, gotoEnd, type ) { + stop: function( type, clearQueue, gotoEnd ) { + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } diff --git a/test/unit/effects.js b/test/unit/effects.js index 4b565a2d1..b52e2414f 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -659,7 +659,7 @@ test("stop(clearQueue, gotoEnd)", function() { }, 100); }); -asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() { +asyncTest( "stop( queue, ..., ... ) - Stop single queues", function() { expect( 3 ); var foo = jQuery( "#foo" ), saved; @@ -681,7 +681,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() { },{ duration: 1000, queue: "height" - }).dequeue( "height" ).stop( false, true, "height" ); + }).dequeue( "height" ).stop( "height", false, true ); equals( foo.height(), 400, "Height was stopped with gotoEnd" ); @@ -690,7 +690,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() { },{ duration: 1000, queue: "height" - }).dequeue( "height" ).stop( false, false, "height" ); + }).dequeue( "height" ).stop( "height", false, false ); saved = foo.height(); });