fixed "Illegal Invocation" of request animation frame
This commit is contained in:
parent
bb5d042db5
commit
81a46f3495
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user