Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Effects - Allow queue: true - Fixes #10445 #535

Merged
merged 1 commit into from

3 participants

Corey Frang Rick Waldron Julian Aubourg
Rick Waldron
Collaborator

Weird, but beautiful :)

Julian Aubourg jaubourg merged commit c51a970 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 7, 2011
  1. Corey Frang
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 4 deletions.
  1. +2 −2 src/effects.js
  2. +21 −2 test/unit/effects.js
4 src/effects.js
View
@@ -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";
}
23 test/unit/effects.js
View
@@ -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);
Something went wrong with that request. Please try again.