diff options
author | John Resig <jeresig@gmail.com> | 2009-11-07 17:22:35 +0100 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-11-07 17:22:35 +0100 |
commit | 3106039aa89410c9abae9947b2520d9c8e62f8f0 (patch) | |
tree | a17e76294223d492916b51a5ed33e1e2b4874ad5 | |
parent | b0fe380cf89564305646bbd55d1fd7bd210fd591 (diff) | |
download | jquery-3106039aa89410c9abae9947b2520d9c8e62f8f0.tar.gz jquery-3106039aa89410c9abae9947b2520d9c8e62f8f0.zip |
Made sure that animate callbacks get executed even when no properties are passed in. Fixes #5459.
-rw-r--r-- | src/fx.js | 6 | ||||
-rw-r--r-- | test/unit/fx.js | 12 |
2 files changed, 17 insertions, 1 deletions
@@ -164,6 +164,10 @@ jQuery.fn.extend({ } }); + if ( jQuery.isEmptyObject( prop ) ) { + return optall.complete.call(this); + } + // For JS strict compliance return true; }); @@ -427,4 +431,4 @@ if ( jQuery.expr && jQuery.expr.filters ) { return elem === fn.elem; }).length; }; -}
\ No newline at end of file +} diff --git a/test/unit/fx.js b/test/unit/fx.js index c47fe558f..c2bf6b43f 100644 --- a/test/unit/fx.js +++ b/test/unit/fx.js @@ -67,6 +67,18 @@ test("animate option (queue === false)", function () { }); */ +test("animate with no properties", function() { + expect(1); + + var divs = jQuery("div"), count = 0; + + divs.animate({}, function(){ + count++; + }); + + equals( divs.length, count, "Make sure that callback is called for each element in the set." ); +}); + test("animate duration 0", function() { expect(7); |