Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-25 11:09:28 -0700
committerCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-25 11:09:28 -0700
commitfd7bccda92563da8ed055d773e173b760880e524 (patch)
tree4f492f3c80026e288c3a5cdaf5ad98dbb62dfff6 /index.js
parent16843364d3302339b67d19738d3201589da6b4e9 (diff)
Add 'Clear Firing Arcs' buttons
Diffstat (limited to 'index.js')
-rw-r--r--index.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/index.js b/index.js
index 15764a1..dfff1a3 100644
--- a/index.js
+++ b/index.js
@@ -354,4 +354,12 @@ document.querySelectorAll('.set-firing-arc').forEach(el => el.addEventListener('
document.querySelector('circle#point').style.display = 'none';
}
}
-})); \ No newline at end of file
+}));
+
+document.querySelectorAll('.clear-firing-arcs').forEach(el =>
+ el.addEventListener('click', ({target: {dataset: {allegiance}}}) =>
+ document
+ .querySelectorAll(`.firing-arc[data-troop-allegiance="${allegiance}"]`)
+ .forEach(el => el.remove())
+ )
+); \ No newline at end of file