mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Effect: Make .transfer() callback optional
Adds two tests to at least check that no exception is thrown. Fixes #12223 Closes gh-1545
This commit is contained in:
parent
897a238332
commit
8b89f8c59b
@ -258,6 +258,32 @@ test( "createPlaceholder: preserves layout affecting properties", function() {
|
||||
deepEqual( before.outerHeight, placeholder.outerHeight( true ), "height preserved" );
|
||||
});
|
||||
|
||||
module( "transfer" );
|
||||
|
||||
asyncTest( "transfer() without callback", function() {
|
||||
expect( 0 );
|
||||
|
||||
// Verify that the effect works without a callback
|
||||
$( "#elem" ).transfer( {
|
||||
to: ".animateClass",
|
||||
duration: 1
|
||||
} );
|
||||
setTimeout( function() {
|
||||
start();
|
||||
}, 25 );
|
||||
} );
|
||||
|
||||
asyncTest( "transfer() with callback", function() {
|
||||
expect( 1 );
|
||||
$( "#elem" ).transfer( {
|
||||
to: ".animateClass",
|
||||
duration: 1
|
||||
}, function() {
|
||||
ok( true, "callback invoked" );
|
||||
start();
|
||||
} );
|
||||
} );
|
||||
|
||||
$.each( $.effects.effect, function( effect ) {
|
||||
module( "effects." + effect );
|
||||
|
||||
|
@ -1505,7 +1505,9 @@ $.fn.extend({
|
||||
})
|
||||
.animate( animation, options.duration, options.easing, function() {
|
||||
transfer.remove();
|
||||
done();
|
||||
if ( $.isFunction( done ) ) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user