aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2013-05-25 10:18:57 -0400
committerRichard Gibson <richard.gibson@gmail.com>2013-05-28 16:49:48 -0400
commit6fd5e480c1cd3e481e7097763ee281b65bc74306 (patch)
treed6a4493c4bab9663ed6d7dc8fa5cb07465fd2db8 /src
parent68c9d0528c43d89cbdab302c68924fb11cd3439c (diff)
downloadjquery-6fd5e480c1cd3e481e7097763ee281b65bc74306.tar.gz
jquery-6fd5e480c1cd3e481e7097763ee281b65bc74306.zip
Fix #13937: Correctly scope .finish() following multi-element .animate(). Thanks @gnarf37. Close gh-1279.
(cherry picked from commit ae9e05e9f3cb071232b056005755acb5926e403e)
Diffstat (limited to 'src')
-rw-r--r--src/effects.js8
-rw-r--r--src/queue.js1
2 files changed, 3 insertions, 6 deletions
diff --git a/src/effects.js b/src/effects.js
index cb78b5cfe..b0a9083e7 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -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
diff --git a/src/queue.js b/src/queue.js
index 46b9ba8fc..1297bc1b4 100644
--- a/src/queue.js
+++ b/src/queue.js
@@ -35,7 +35,6 @@ jQuery.extend({
startLength--;
}
- hooks.cur = fn;
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being