fixed "Illegal Invocation" of request animation frame

This commit is contained in:
e7d 2017-05-14 14:38:42 +02:00
parent bb5d042db5
commit 81a46f3495

View File

@ -1,9 +1,6 @@
class Gamepad { class Gamepad {
constructor() { constructor() {
this.haveEvents = 'GamepadEvent' in window; this.haveEvents = 'GamepadEvent' in window;
this.rAF = window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.requestAnimationFrame;
// cached DOM references // cached DOM references
this.$gamepad = $('.gamepad'); this.$gamepad = $('.gamepad');
@ -291,7 +288,7 @@ class Gamepad {
} }
// enqueue the next refresh right away // enqueue the next refresh right away
this.rAF(this.updateStatus.bind(this)); window.requestAnimationFrame(this.updateStatus.bind(this));
// load latest gamepad data // load latest gamepad data
this.refreshGamepads(); this.refreshGamepads();