From abb5917eabac5f6da6841c35567c706066409e44 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Tue, 10 Mar 2020 13:21:36 +0100 Subject: [PATCH] Fix error iterating on getElementsByClassName on mobile browsers --- client/src/components/MoveList.vue | 4 ++-- client/src/views/Game.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 6e3a90d5..ded140d9 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -79,8 +79,8 @@ export default { processModalClick); if ("ontouchstart" in window) { // Disable tooltips on smartphones: - document.getElementsByClassName("tooltip").forEach(elt => { - elt.classList.remove("tooltip"); + document.querySelectorAll("#aboveMoves .tooltip").forEach(elt => { + elt.classList.remove("tooltip") }); } // Take full width on small screens: diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index e909f70e..009dbb47 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -221,8 +221,8 @@ export default { .addEventListener("click", processModalClick); if ("ontouchstart" in window) { // Disable tooltips on smartphones: - document.getElementsByClassName("tooltip").forEach(elt => { - elt.classList.remove("tooltip"); + document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => { + elt.classList.remove("tooltip") }); } }, -- 2.44.0