Commit 076c3476 authored by louisremi's avatar louisremi

.animate() Callbacks should fire in correct order (fix #9100 + unit test)

parent b5772da0
...@@ -253,7 +253,6 @@ jQuery.fn.extend({ ...@@ -253,7 +253,6 @@ jQuery.fn.extend({
if ( !gotoEnd ) { if ( !gotoEnd ) {
jQuery._unmark( true, this ); jQuery._unmark( true, this );
} }
// go in reverse order so anything added to the queue during the loop is ignored
while ( i-- ) { while ( i-- ) {
if ( timers[i].elem === this ) { if ( timers[i].elem === this ) {
if (gotoEnd) { if (gotoEnd) {
...@@ -517,11 +516,9 @@ jQuery.fx.prototype = { ...@@ -517,11 +516,9 @@ jQuery.fx.prototype = {
jQuery.extend( jQuery.fx, { jQuery.extend( jQuery.fx, {
tick: function() { tick: function() {
var timers = jQuery.timers, for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
i = timers.length;
while ( i-- ) {
if ( !timers[i]() ) { if ( !timers[i]() ) {
timers.splice(i, 1); timers.splice(i--, 1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment