From 9a9ea68f9c9fc7a394522c75abec6cf62d9da598 Mon Sep 17 00:00:00 2001 From: Jacob Williams <47766188+BotSpace@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:24:43 -0500 Subject: [PATCH] actually actually fixed mobile switches --- index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index da8b352..09adbbf 100644 --- a/index.js +++ b/index.js @@ -35,10 +35,15 @@ document.addEventListener('DOMContentLoaded', function () { updateSlider(toggleLegacyPacket, toggleState=false); updateInfoSlider(toggleInfo, toggleState=false); - toggleMobile.addEventListener('click', updateMobileSlider.bind(null, toggleMobile, toggleState=true)); - toggleKeyboardWASD.addEventListener('click', updateSlider.bind(null, toggleKeyboardWASD, toggleState=true)); - toggleLegacyPacket.addEventListener('click', updateSlider.bind(null, toggleLegacyPacket, toggleState=true)); - toggleInfo.addEventListener('click', updateInfoSlider.bind(null, toggleInfo, toggleState=true)); + toggleMobile.addEventListener('mousedown', updateMobileSlider.bind(null, toggleMobile, toggleState=true)); + toggleKeyboardWASD.addEventListener('mousedown', updateSlider.bind(null, toggleKeyboardWASD, toggleState=true)); + toggleLegacyPacket.addEventListener('mousedown', updateSlider.bind(null, toggleLegacyPacket, toggleState=true)); + toggleInfo.addEventListener('mousedown', updateInfoSlider.bind(null, toggleInfo, toggleState=true)); + + toggleMobile.addEventListener('touchstart', updateMobileSlider.bind(null, toggleMobile, toggleState=true)); + toggleKeyboardWASD.addEventListener('touchstart', updateSlider.bind(null, toggleKeyboardWASD, toggleState=true)); + toggleLegacyPacket.addEventListener('touchstart', updateSlider.bind(null, toggleLegacyPacket, toggleState=true)); + toggleInfo.addEventListener('touchstart', updateInfoSlider.bind(null, toggleInfo, toggleState=true)); window.setInterval(renderLoop, 40); // call renderLoop every num milliseconds });