Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #535 from gnarf37/queue-true

Effects - Allow queue: true - Fixes #10445
  • Loading branch information...
commit c51a9706046de19d051b57771f67e5bf2bcd937f 2 parents e828d18 + 1ba0f9c
Julian Aubourg jaubourg authored

Showing 2 changed files with 23 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 2 src/effects.js
  2. +21 2 test/unit/effects.js
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);

0 comments on commit c51a970

Please sign in to comment.
Something went wrong with that request. Please try again.