Completes #11799: Maybe .progress() was cooler than I thought.

Generate a .progress() for each step of an animation, once all properties are changed. Closes gh-835.
This commit is contained in:
Corey Frang
2012-06-23 16:50:57 -05:00
committed by Dave Methvin
parent a2758377df
commit c436ae04de
2 changed files with 21 additions and 6 deletions

5
src/effects.js vendored
View File

@@ -91,6 +91,8 @@ function Animation( elem, properties, options ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ]);
if ( percent < 1 && length ) {
return remaining;
} else {
@@ -159,7 +161,8 @@ function Animation( elem, properties, options ) {
);
// attach callbacks from options
return animation.done( animation.opts.done, animation.opts.complete )
return animation.progress( animation.opts.progress )
.done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}