Add 'Clear Firing Arcs' buttons
This commit is contained in:
parent
16843364d3
commit
fd7bccda92
12
index.html
12
index.html
@ -146,7 +146,11 @@
|
|||||||
<div>
|
<div>
|
||||||
<!-- <img class="logo" src="logo-davion.png" /> -->
|
<!-- <img class="logo" src="logo-davion.png" /> -->
|
||||||
<p>
|
<p>
|
||||||
Davion<br>
|
Davion
|
||||||
|
<button type="button" class="clear-firing-arcs" data-allegiance="davion">
|
||||||
|
Clear Firing Arcs
|
||||||
|
</button>
|
||||||
|
<br>
|
||||||
<!-- 1st Squad, 3rd Platoon, Bravo Company, 2nd Battalion<br>
|
<!-- 1st Squad, 3rd Platoon, Bravo Company, 2nd Battalion<br>
|
||||||
17th Kestral Mechanized Infantry -->
|
17th Kestral Mechanized Infantry -->
|
||||||
</p>
|
</p>
|
||||||
@ -175,7 +179,11 @@
|
|||||||
<div>
|
<div>
|
||||||
<!-- <img class="logo" src="logo-liao.png" /> -->
|
<!-- <img class="logo" src="logo-liao.png" /> -->
|
||||||
<p>
|
<p>
|
||||||
Liao<br>
|
Liao
|
||||||
|
<button type="button" class="clear-firing-arcs" data-allegiance="liao">
|
||||||
|
Clear Firing Arcs
|
||||||
|
</button>
|
||||||
|
<br>
|
||||||
<!-- 2nd Squad, 1st Platoon, 3rd Company, 2nd Battalion<br>
|
<!-- 2nd Squad, 1st Platoon, 3rd Company, 2nd Battalion<br>
|
||||||
Aldebaran Home Guard -->
|
Aldebaran Home Guard -->
|
||||||
</p>
|
</p>
|
||||||
|
10
index.js
10
index.js
@ -354,4 +354,12 @@ document.querySelectorAll('.set-firing-arc').forEach(el => el.addEventListener('
|
|||||||
document.querySelector('circle#point').style.display = 'none';
|
document.querySelector('circle#point').style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
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())
|
||||||
|
)
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user