Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Merged
merged 1 commit into from over 2 years ago

3 participants

Corey Frang Rick Waldron Julian Aubourg
Rick Waldron
Collaborator

Weird, but beautiful :)

Julian Aubourg jaubourg merged commit c51a970 into from October 07, 2011
Julian Aubourg jaubourg closed this October 07, 2011
Oleg Gaidarenko markelog referenced this pull request from a commit January 11, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 07, 2011
Corey Frang Effects - Allow queue: true - Fixes #10445 1ba0f9c
This page is out of date. Refresh to see the latest.
4  src/effects.js
@@ -352,8 +352,8 @@ jQuery.extend({
352 352
 		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
353 353
 			opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
354 354
 
355  
-		// if undefined, set to fx
356  
-		if ( opt.queue == null ) {
  355
+		// normalize opt.queue - true/undefined/null -> "fx"
  356
+		if ( opt.queue == null || opt.queue === true ) {
357 357
 			opt.queue = "fx";
358 358
 		}
359 359
 
23  test/unit/effects.js
@@ -390,6 +390,25 @@ asyncTest( "animate option { queue: false }", function() {
390 390
 	equals( foo.queue().length, 0, "Queue is empty" );
391 391
 });
392 392
 
  393
+asyncTest( "animate option { queue: true }", function() {
  394
+	expect( 2 );
  395
+	var foo = jQuery( "#foo" );
  396
+
  397
+	foo.animate({
  398
+		fontSize: "2em"
  399
+	}, {
  400
+		queue: true,
  401
+		duration: 10,
  402
+		complete: function() {
  403
+			ok( true, "Animation Completed" );
  404
+			start();
  405
+		}
  406
+	});
  407
+
  408
+	notEqual( foo.queue().length, 0, "Default queue is not empty" );
  409
+});
  410
+
  411
+
393 412
 asyncTest( "animate option { queue: 'name' }", function() {
394 413
 	expect( 5 );
395 414
 	var foo = jQuery( "#foo" ),
@@ -652,7 +671,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() {
652 671
 		duration: 1000,
653 672
 		complete: function() {
654 673
 			equals( foo.width(), 400, "Animation completed for standard queue" );
655  
-			equals( foo.height(), saved, "Height was not changed after the second stop")
  674
+			equals( foo.height(), saved, "Height was not changed after the second stop");
656 675
 			start();
657 676
 		}
658 677
 	});
@@ -673,7 +692,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() {
673 692
 		queue: "height"
674 693
 	}).dequeue( "height" ).stop( false, false, "height" );
675 694
 	saved = foo.height();
676  
-})
  695
+});
677 696
 
678 697
 test("toggle()", function() {
679 698
 	expect(6);
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.