From 1cb776d56b303fc3becd47fe5a5aa49a63865a1a Mon Sep 17 00:00:00 2001 From: e7d Date: Sun, 14 May 2017 10:08:39 +0200 Subject: [PATCH] fixed ds4 template for es6 --- templates/ds4/template.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/templates/ds4/template.js b/templates/ds4/template.js index 9a7edad..09f324d 100644 --- a/templates/ds4/template.js +++ b/templates/ds4/template.js @@ -1,5 +1,5 @@ -function updateButton($button) { - value = parseFloat($button.attr('data-value'), 10); +gamepad.updateButton = function($button) { + const value = parseFloat($button.attr('data-value'), 10); if ($button.is('.trigger')) { $button.css({ @@ -8,12 +8,10 @@ function updateButton($button) { } } -var axisX, axisY, axisZ; - -function updateAxis($axis) { - axisX = $axis.attr('data-value-x'); - axisY = $axis.attr('data-value-y'); - axisZ = $axis.attr('data-value-z'); +gamepad.updateAxis = function($axis) { + const axisX = $axis.attr('data-value-x'); + const axisY = $axis.attr('data-value-y'); + const axisZ = $axis.attr('data-value-z'); if ($axis.is('.stick')) { $axis.css({