mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Effects: First step() call should match :animated selector
(cherry picked from commit 085814474e
)
Fixes #14623
Closes gh-1473
This commit is contained in:
parent
ab1224dd2d
commit
09b28534fa
5
src/effects.js
vendored
5
src/effects.js
vendored
@ -616,8 +616,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();
|
||||
}
|
||||
};
|
||||
|
||||
|
15
test/unit/effects.js
vendored
15
test/unit/effects.js
vendored
@ -1608,6 +1608,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>");
|
||||
|
Loading…
Reference in New Issue
Block a user