mirror of
https://github.com/jquery/jquery.git
synced 2026-02-08 00:55:03 -05:00
Landing pull request 520. Unset the complete function just before calling it to avoid an exception creating a loop. Fixes #5684.
More Details: - https://github.com/jquery/jquery/pull/520 - http://bugs.jquery.com/ticket/5684
This commit is contained in:
16
src/effects.js
vendored
16
src/effects.js
vendored
@@ -481,11 +481,11 @@ jQuery.fx.prototype = {
|
||||
|
||||
// Each step of an animation
|
||||
step: function( gotoEnd ) {
|
||||
var t = fxNow || createFxNow(),
|
||||
var p, n, complete,
|
||||
t = fxNow || createFxNow(),
|
||||
done = true,
|
||||
elem = this.elem,
|
||||
options = this.options,
|
||||
p, n;
|
||||
options = this.options;
|
||||
|
||||
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
||||
this.now = this.end;
|
||||
@@ -525,7 +525,15 @@ jQuery.fx.prototype = {
|
||||
}
|
||||
|
||||
// Execute the complete function
|
||||
options.complete.call( elem );
|
||||
// in the event that the complete function throws an exception
|
||||
// we must ensure it won't be called twice. #5684
|
||||
|
||||
complete = options.complete;
|
||||
if ( complete ) {
|
||||
|
||||
options.complete = false;
|
||||
complete.call( elem );
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user