From 17e6a7812f0792cb9f3f3f5084c5555cf3bf18b8 Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Mon, 16 Jun 2025 22:41:28 -0700 Subject: [PATCH] Fix unselecting selected record --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index df7d3e7..abd9794 100644 --- a/index.js +++ b/index.js @@ -709,8 +709,14 @@ POINTS.forEach((row, index) => row.forEach(([x, y]) => { document.querySelectorAll('.soldier-record').forEach(el => el.addEventListener('click', e => { - RecordSheet.select(el); - Counter.select(el); + if (el.classList.contains('selected')) { + el.classList.remove('selected'); + RecordSheet.unSelect(); + Counter.unSelect(); + } else { + RecordSheet.select(el); + Counter.select(el); + } let sl = svg.querySelector('.sight-line');