mirror of
https://github.com/jquery/jquery.git
synced 2026-02-03 04:15:03 -05:00
Fix #13937: Correctly scope .finish() following multi-element .animate(). Thanks @gnarf37. Close gh-1279.
(cherry picked from commit ae9e05e9f3)
This commit is contained in:
8
src/effects.js
vendored
8
src/effects.js
vendored
@@ -488,9 +488,7 @@ jQuery.fn.extend({
|
||||
doAnimation = function() {
|
||||
// Operate on a copy of prop so per-property easing won't be lost
|
||||
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
|
||||
doAnimation.finish = function() {
|
||||
anim.stop( true );
|
||||
};
|
||||
|
||||
// Empty animations, or finishing resolves immediately
|
||||
if ( empty || data_priv.get( this, "finish" ) ) {
|
||||
anim.stop( true );
|
||||
@@ -570,8 +568,8 @@ jQuery.fn.extend({
|
||||
// empty the queue first
|
||||
jQuery.queue( this, type, [] );
|
||||
|
||||
if ( hooks && hooks.cur && hooks.cur.finish ) {
|
||||
hooks.cur.finish.call( this );
|
||||
if ( hooks && hooks.stop ) {
|
||||
hooks.stop.call( this, true );
|
||||
}
|
||||
|
||||
// look for any active animations, and finish them
|
||||
|
||||
@@ -35,7 +35,6 @@ jQuery.extend({
|
||||
startLength--;
|
||||
}
|
||||
|
||||
hooks.cur = fn;
|
||||
if ( fn ) {
|
||||
|
||||
// Add a progress sentinel to prevent the fx queue from being
|
||||
|
||||
Reference in New Issue
Block a user