Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-25 12:54:27 -0700
committerCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-25 12:54:27 -0700
commitde5f3c266677590d63fda98f25085b4327710def (patch)
tree6dddcb0f0bdb3904d1c1282ea85f0f683983b22c /index.js
parentfd7bccda92563da8ed055d773e173b760880e524 (diff)
Clean up some styles
Diffstat (limited to 'index.js')
-rw-r--r--index.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/index.js b/index.js
index dfff1a3..deef03b 100644
--- a/index.js
+++ b/index.js
@@ -300,15 +300,13 @@ map.addEventListener('mousemove', e => {
document.querySelectorAll('.soldier-record').forEach(el =>
el.addEventListener('click', e => {
- if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'LABEL') {
- if (el.classList.contains('selected')) {
- el.classList.remove('selected');
- } else {
- document.querySelectorAll('.soldier-record.selected').forEach(el =>
- el.classList.remove('selected')
- );
- el.classList.add('selected');
- }
+ if (el.classList.contains('selected')) {
+ el.classList.remove('selected');
+ } else {
+ document.querySelectorAll('.soldier-record.selected').forEach(el =>
+ el.classList.remove('selected')
+ );
+ el.classList.add('selected');
}
})
);