From 90763f8cefc9f456efcd50b7e720759401c5c6d8 Mon Sep 17 00:00:00 2001 From: Wim Barelds Date: Mon, 21 Apr 2014 16:11:27 +0200 Subject: [PATCH] Fixed bug with cancelAnimationFrame not getting vendor specific prefix, and only not checking if cancelAnimationFrame existed alongside requestAnimationFrame. --- inc/TimeCircles.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/TimeCircles.js b/inc/TimeCircles.js index 79412a5..24b7be2 100644 --- a/inc/TimeCircles.js +++ b/inc/TimeCircles.js @@ -162,8 +162,10 @@ var vendors = ['webkit', 'moz']; for(var x = 0; x < vendors.length && !window.top.requestAnimationFrame; ++x) { window.top.requestAnimationFrame = window.top[vendors[x]+'RequestAnimationFrame']; + window.top.cancelAnimationFrame = window.top[vendors[x]+'CancelAnimationFrame']; } - if (!window.top.requestAnimationFrame) { + + if (!window.top.requestAnimationFrame || !window.top.cancelAnimationFrame) { window.top.requestAnimationFrame = function(callback, element, instance) { if(typeof instance === "undefined") instance = { data: { last_frame: 0 } }; var currTime = new Date().getTime(); @@ -176,7 +178,7 @@ }; window.top.cancelAnimationFrame = function(id) { clearTimeout(id); - } + }; } })();