From: Benjamin Auder Date: Tue, 10 Mar 2020 12:21:36 +0000 (+0100) Subject: Fix error iterating on getElementsByClassName on mobile browsers X-Git-Url: https://git.auder.net/variants/doc/html/img/cross.svg?a=commitdiff_plain;h=abb5917eabac5f6da6841c35567c706066409e44;p=vchess.git Fix error iterating on getElementsByClassName on mobile browsers --- 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") }); } },