Landing pull request 374. .animate() Callbacks should fire in correct order (unit test included). Fixes #9100.

More Details:
 - https://github.com/jquery/jquery/pull/374
 - https://github.com/jquery/jquery/issues/9100
This commit is contained in:
louisremi 2011-05-10 11:22:12 -04:00 committed by John Resig
commit 521ae562da
2 changed files with 18 additions and 5 deletions

7
src/effects.js vendored
View file

@ -258,7 +258,6 @@ jQuery.fn.extend({
if ( !gotoEnd ) {
jQuery._unmark( true, this );
}
// go in reverse order so anything added to the queue during the loop is ignored
while ( i-- ) {
if ( timers[i].elem === this ) {
if (gotoEnd) {
@ -522,11 +521,9 @@ jQuery.fx.prototype = {
jQuery.extend( jQuery.fx, {
tick: function() {
var timers = jQuery.timers,
i = timers.length;
while ( i-- ) {
for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
if ( !timers[i]() ) {
timers.splice(i, 1);
timers.splice(i--, 1);
}
}