Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js10
1 files 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');