mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Effects: Resolve issues revealed by recent Callbacks fix
Notify full progress before resolving empty animations
Register animation callbacks before their ticker
Remove the right timer when immediately-done animations spawn more
Ref 9d822bc1c1
Fixes gh-3502
Fixes gh-3503
Closes gh-3496
This commit is contained in:
17
test/unit/effects.js
vendored
17
test/unit/effects.js
vendored
@@ -1256,17 +1256,18 @@ QUnit.test( "animate with CSS shorthand properties", function( assert ) {
|
||||
} );
|
||||
|
||||
QUnit.test( "hide hidden elements, with animation (bug #7141)", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
assert.expect( 4 );
|
||||
|
||||
var div = jQuery( "<div style='display:none'></div>" ).appendTo( "#qunit-fixture" );
|
||||
assert.equal( div.css( "display" ), "none", "Element is hidden by default" );
|
||||
div.hide( 1, function() {
|
||||
assert.ok( !jQuery._data( div, "olddisplay" ), "olddisplay is undefined after hiding an already-hidden element" );
|
||||
div.show( 1, function() {
|
||||
assert.equal( div.css( "display" ), "block", "Show a double-hidden element" );
|
||||
var div = jQuery( "<div id='bug7141' style='display:none'/>" ).appendTo( "#qunit-fixture" );
|
||||
assert.equal( div.css( "display" ), "none", "Element is initially hidden" );
|
||||
div.hide( 10, function() {
|
||||
assert.equal( div.css( "display" ), "none", "Element is hidden in .hide() callback" );
|
||||
div.show( 11, function() {
|
||||
assert.equal( div.css( "display" ), "block", "Element is visible in .show() callback" );
|
||||
} );
|
||||
} );
|
||||
this.clock.tick( 10 );
|
||||
this.clock.tick( 50 );
|
||||
assert.equal( div.css( "display" ), "block", "Element is visible after animations" );
|
||||
} );
|
||||
|
||||
QUnit.test( "animate unit-less properties (#4966)", function( assert ) {
|
||||
|
||||
Reference in New Issue
Block a user