[Pkg-javascript-commits] [leaflet] 11/40: Remove duplicate requestAnimFrame.

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:33:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet.

commit ce7a753efa3a8a950491ca03e2591ad60a825c9b
Author: Per Liedman <per at liedman.net>
Date:   Tue Apr 15 21:54:56 2014 +0200

    Remove duplicate requestAnimFrame.
---
 src/core/Util.js | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/src/core/Util.js b/src/core/Util.js
index 22c8d40..b903098 100644
--- a/src/core/Util.js
+++ b/src/core/Util.js
@@ -175,44 +175,6 @@ L.Util = {
 
 }());
 
-(function () {
-	// inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/
-
-	function getPrefixed(name) {
-		return window['webkit' + name] || window['moz' + name] || window['ms' + name];
-	}
-
-	var lastTime = 0;
-
-	// fallback for IE 7-8
-	function timeoutDefer(fn) {
-		var time = +new Date(),
-		    timeToCall = Math.max(0, 16 - (time - lastTime));
-
-		lastTime = time + timeToCall;
-		return window.setTimeout(fn, timeToCall);
-	}
-
-	var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer,
-	    cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||
-	               getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };
-
-
-	L.Util.requestAnimFrame = function (fn, context, immediate, element) {
-		if (immediate && requestFn === timeoutDefer) {
-			fn.call(context);
-		} else {
-			return requestFn.call(window, L.bind(fn, context), element);
-		}
-	};
-
-	L.Util.cancelAnimFrame = function (id) {
-		if (id) {
-			cancelFn.call(window, id);
-		}
-	};
-})();
-
 // shortcuts for most used utility functions
 L.extend = L.Util.extend;
 L.bind = L.Util.bind;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git



More information about the Pkg-javascript-commits mailing list