From 76576ef297ab28e5370a8c262d04790afb2af78a Mon Sep 17 00:00:00 2001 From: e7d Date: Fri, 11 Nov 2016 10:01:01 +0100 Subject: [PATCH] made scripts ladaing async --- js/gamepad.js | 6 +++--- templates/ds4/template.html | 2 +- templates/xbox-one/template.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/gamepad.js b/js/gamepad.js index c2a4e5c..01fbd51 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -192,6 +192,8 @@ function updateVisualStatus() { return; } + requestAnimationFrame(updateVisualStatus); + var button; var $button; for (var buttonIndex = 0; buttonIndex < activeGamepad.buttons.length; buttonIndex++) { @@ -234,8 +236,6 @@ function updateVisualStatus() { updateAxis($axis); } } - - requestAnimationFrame(updateVisualStatus); } function changeGamepadColor(gamepadColor) { @@ -291,7 +291,7 @@ function changeZoom(zoomLevel) { activeGamepadZoomLevel = zoomLevel; } - // hack: fix floatjs float issues + // hack: fix js float issues activeGamepadZoomLevel = +activeGamepadZoomLevel.toFixed(1); $gamepad.css('transform', 'translate(-50%, -50%) scale(' + activeGamepadZoomLevel + ', ' + activeGamepadZoomLevel + ')'); diff --git a/templates/ds4/template.html b/templates/ds4/template.html index ad44d30..58d6815 100644 --- a/templates/ds4/template.html +++ b/templates/ds4/template.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/xbox-one/template.html b/templates/xbox-one/template.html index 21f5ae1..65c415f 100644 --- a/templates/xbox-one/template.html +++ b/templates/xbox-one/template.html @@ -1,5 +1,5 @@ - +