]> source.dussan.org Git - jquery.git/commitdiff
Separate raf function definition from passing it to requestAnimationFrame 298/head
authortimmywil <tim.willison@thisismedium.com>
Sun, 10 Apr 2011 21:17:34 +0000 (17:17 -0400)
committertimmywil <tim.willison@thisismedium.com>
Sun, 10 Apr 2011 21:17:34 +0000 (17:17 -0400)
src/effects.js
src/sizzle

index 727c1a7a9b613aa86bf41754a7d4366670390d66..976fe765b4a0b01317809f86ad62a4c756cd92a8 100644 (file)
@@ -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 );
                        }
index f12b9309269ba7e705a99efe099f86ed1fe98d58..80f2b81d1fbc13d62afb91cb87e1452fbbec1ef4 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f12b9309269ba7e705a99efe099f86ed1fe98d58
+Subproject commit 80f2b81d1fbc13d62afb91cb87e1452fbbec1ef4