Commit 791402b4 authored by timmywil's avatar timmywil

Separate raf function definition from passing it to requestAnimationFrame

parent 9db18ddd
......@@ -350,7 +350,8 @@ jQuery.fx.prototype = {
// Start an animation from one number to another
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx;
fx = jQuery.fx,
raf;
this.startTime = jQuery.now();
this.start = from;
......@@ -369,13 +370,14 @@ jQuery.fx.prototype = {
// Use requestAnimationFrame instead of setInterval if available
if ( requestAnimationFrame ) {
timerId = 1;
requestAnimationFrame(function raf() {
raf = function() {
// When timerId gets set to null at any point, this stops
if ( timerId ) {
requestAnimationFrame( raf );
fx.tick();
}
});
};
requestAnimationFrame( raf );
} else {
timerId = setInterval( fx.tick, fx.interval );
}
......
Subproject commit f12b9309269ba7e705a99efe099f86ed1fe98d58
Subproject commit 80f2b81d1fbc13d62afb91cb87e1452fbbec1ef4
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