diff options
author | Julian Aubourg <j@ubourg.net> | 2011-10-07 08:52:54 -0700 |
---|---|---|
committer | Julian Aubourg <j@ubourg.net> | 2011-10-07 08:52:54 -0700 |
commit | c51a9706046de19d051b57771f67e5bf2bcd937f (patch) | |
tree | b2c564493b288de6bb4922afbf2cd1a33171a082 | |
parent | e828d18caa31822a27f4365b123405394ef4577d (diff) | |
parent | 1ba0f9c3ed7d7d8ecf245a5fc7cdf442652927f8 (diff) | |
download | jquery-c51a9706046de19d051b57771f67e5bf2bcd937f.tar.gz jquery-c51a9706046de19d051b57771f67e5bf2bcd937f.zip |
Merge pull request #535 from gnarf37/queue-true
Effects - Allow queue: true - Fixes #10445
-rw-r--r-- | src/effects.js | 4 | ||||
-rw-r--r-- | test/unit/effects.js | 23 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/effects.js b/src/effects.js index 67ac8bb41..147763d63 100644 --- a/src/effects.js +++ b/src/effects.js @@ -352,8 +352,8 @@ jQuery.extend({ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; - // if undefined, set to fx - if ( opt.queue == null ) { + // normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } diff --git a/test/unit/effects.js b/test/unit/effects.js index 2492ea08c..4b565a2d1 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -390,6 +390,25 @@ asyncTest( "animate option { queue: false }", function() { equals( foo.queue().length, 0, "Queue is empty" ); }); +asyncTest( "animate option { queue: true }", function() { + expect( 2 ); + var foo = jQuery( "#foo" ); + + foo.animate({ + fontSize: "2em" + }, { + queue: true, + duration: 10, + complete: function() { + ok( true, "Animation Completed" ); + start(); + } + }); + + notEqual( foo.queue().length, 0, "Default queue is not empty" ); +}); + + asyncTest( "animate option { queue: 'name' }", function() { expect( 5 ); var foo = jQuery( "#foo" ), @@ -652,7 +671,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() { duration: 1000, complete: function() { equals( foo.width(), 400, "Animation completed for standard queue" ); - equals( foo.height(), saved, "Height was not changed after the second stop") + equals( foo.height(), saved, "Height was not changed after the second stop"); start(); } }); @@ -673,7 +692,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() { queue: "height" }).dequeue( "height" ).stop( false, false, "height" ); saved = foo.height(); -}) +}); test("toggle()", function() { expect(6); |