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/doc/html/%7B%7B%20path%28%27mixstore_user_board%27%29%20%7D%7D?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") }); } },