Avoid hiding firing arc if visibility is toggled when changing unit selection
This commit is contained in:
parent
f73241afb8
commit
ba1e9009a3
16
index.js
16
index.js
@ -605,8 +605,20 @@ const RecordSheet = new function() {
|
||||
let unclipped = document.querySelectorAll('#firing-arcs polygon:not([clip-path])');
|
||||
|
||||
unclipped.forEach(el => {
|
||||
let { troopNumber, troopAllegiance } = el.dataset;
|
||||
el.setAttributeNS(null, 'clip-path', `url(#clip-path-${troopAllegiance}-${troopNumber})`);
|
||||
let { troopNumber, troopAllegiance } = el.dataset,
|
||||
clipPathId = `clip-path-${troopAllegiance}-${troopNumber}`;
|
||||
|
||||
let isVisible =
|
||||
document
|
||||
.getElementById('toggle-firing-arc-vis')
|
||||
.querySelector(`input[data-allegiance="${troopAllegiance}"]`)
|
||||
.checked;
|
||||
|
||||
if (isVisible) {
|
||||
document.getElementById(clipPathId).style.display = 'none';
|
||||
}
|
||||
|
||||
el.setAttributeNS(null, 'clip-path', `url(#${clipPathId})`);
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user