fixes TypeError: Illegal Invocation in node-webkit

requestAnimationFrame, setTimeout and clearTimeout need to be called on the window object explicitely in node-webkit.
This commit is contained in:
Ondrej 2015-01-14 22:13:21 +01:00
parent d3263d77e2
commit 9391a789ea

View file

@ -11,8 +11,8 @@ var m = (function app(window, undefined) {
function initialize(window){
$document = window.document;
$location = window.location;
$cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout;
$requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;
$cancelAnimationFrame = (window.cancelAnimationFrame || window.clearTimeout).bind(window);
$requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout).bind(window);
}
initialize(window);