put the preventElementZoom call into a method instead to call it from anywhere/anytime we import it (#1515)
This commit is contained in:
parent
a163a420bd
commit
0385a90f08
|
@ -3,6 +3,8 @@ export const keysDown = new Map();
|
||||||
let lastTouchedId;
|
let lastTouchedId;
|
||||||
|
|
||||||
export function initTouchControls(buttonMap) {
|
export function initTouchControls(buttonMap) {
|
||||||
|
const dpadDiv = document.querySelector("#dpad");
|
||||||
|
preventElementZoom(dpadDiv);
|
||||||
for (const button of document.querySelectorAll("[data-key]")) {
|
for (const button of document.querySelectorAll("[data-key]")) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
bindKey(button, button.dataset.key, buttonMap);
|
bindKey(button, button.dataset.key, buttonMap);
|
||||||
|
@ -138,6 +140,3 @@ function preventElementZoom(element) {
|
||||||
event.target.click();
|
event.target.click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const dpadDiv = document.querySelector("#dpad");
|
|
||||||
preventElementZoom(dpadDiv);
|
|
||||||
|
|
Loading…
Reference in New Issue