From b985cf3a33a38ed106f097dfa70e64fb015b1bb5 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Fri, 16 Dec 2022 21:35:26 +0100 Subject: [PATCH] Fix display of selection ring --- Public/grid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/grid.js b/Public/grid.js index 51930e4..189f8c2 100644 --- a/Public/grid.js +++ b/Public/grid.js @@ -24,8 +24,7 @@ function getCapIdAtPosition(position) { return capPositions[position]; } -const selectedCapCircle = document.querySelector("#selected-cap-circle"); -const imageCanvas = document.querySelector("#image-canvas"); +const imageCanvas = document.getElementById("image-canvas"); var capPositions = Array.from( {length: numberOfCaps}, @@ -37,6 +36,7 @@ imageCanvas.innerHTML += capPositions.map(createImage).join(""); var selectedPosition = null; const elements = imageCanvas.getElementsByTagName("img"); +const selectedCapCircle = document.getElementById("selected-cap-circle"); imageCanvas.addEventListener("click", function(event) { const xPosition = event.clientX - imageCanvas.getBoundingClientRect().left;