Skip to content

Commit

Permalink
Effects: First step() call should match :animated selector
Browse files Browse the repository at this point in the history
Fixes #14623
Closes jquerygh-1473
  • Loading branch information
dmethvin committed Jan 7, 2014
1 parent 5801c3a commit 0858144
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/effects.js
Expand Up @@ -610,8 +610,11 @@ jQuery.fx.tick = function() {
};

jQuery.fx.timer = function( timer ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.timers.push( timer );
if ( timer() ) {
jQuery.fx.start();
} else {
jQuery.timers.pop();
}
};

Expand Down
15 changes: 15 additions & 0 deletions test/unit/effects.js
Expand Up @@ -1550,6 +1550,21 @@ test("Animation callback should not show animated element as :animated (#7157)",
this.clock.tick( 100 );
});

test("Initial step callback should show element as :animated (#14623)", 1, function() {
var foo = jQuery( "#foo" );

foo.animate({
opacity: 0,
}, {
duration: 100,
step: function() {
ok( foo.is(":animated"), "The element matches :animated inside step function" );
}
});
this.clock.tick( 1 );
foo.stop();
});

test( "hide called on element within hidden parent should set display to none (#10045)", 3, function() {
var hidden = jQuery(".hidden"),
elems = jQuery("<div>hide</div><div>hide0</div><div>hide1</div>");
Expand Down

0 comments on commit 0858144

Please sign in to comment.