diff --git a/src/util/Event.js b/src/util/Event.js index c5627ae1..071d6cab 100644 --- a/src/util/Event.js +++ b/src/util/Event.js @@ -108,14 +108,12 @@ Event.requestAnimationFrame = new function() { focus: function() { focused = true; // Switch to falst checkCallback calls while window is focused. - if (timer) - setTimer(fastRate); + timer && setTimer(fastRate); }, blur: function() { focused = false; // Switch to slow checkCallback calls while window is blured. - if (timer) - setTimer(slowRate); + timer && setTimer(slowRate); } }); @@ -123,7 +121,6 @@ Event.requestAnimationFrame = new function() { if (request) return request(callback, element); callbacks.push([callback, element]); - if (!timer) - setTimer(fastRate); + !timer && setTimer(fastRate); }; };