diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-05-25 10:18:57 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-05-28 16:48:55 -0400 |
commit | ae9e05e9f3cb071232b056005755acb5926e403e (patch) | |
tree | 3feae87b202e226139f0901da0988b33ba4b2dbf /src/effects.js | |
parent | 00231d5d94d3374d53bfe79e04ba253250c73087 (diff) | |
download | jquery-ae9e05e9f3cb071232b056005755acb5926e403e.tar.gz jquery-ae9e05e9f3cb071232b056005755acb5926e403e.zip |
Fix #13937: Correctly scope .finish() following multi-element .animate(). Thanks @gnarf37. Close gh-1279.
Diffstat (limited to 'src/effects.js')
-rw-r--r-- | src/effects.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/effects.js b/src/effects.js index b03036ce3..f939ae607 100644 --- a/src/effects.js +++ b/src/effects.js @@ -490,9 +490,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 || jQuery._data( this, "finish" ) ) { anim.stop( true ); @@ -572,8 +570,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 |