Fix using duplicate ids for counters and clip paths
This commit is contained in:
parent
18bb0b885a
commit
6a0ab60dc2
4
index.js
4
index.js
@ -583,7 +583,7 @@ const RecordSheet = new function() {
|
|||||||
|
|
||||||
unclipped.forEach(el => {
|
unclipped.forEach(el => {
|
||||||
let { troopNumber, troopAllegiance } = el.dataset;
|
let { troopNumber, troopAllegiance } = el.dataset;
|
||||||
el.setAttributeNS(null, 'clip-path', `url(#${troopAllegiance}-${troopNumber})`);
|
el.setAttributeNS(null, 'clip-path', `url(#clip-path-${troopAllegiance}-${troopNumber})`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -825,7 +825,7 @@ document.querySelectorAll('.set-firing-arc').forEach(el => el.addEventListener('
|
|||||||
clipShape.setAttributeNS(null, 'r', 100);
|
clipShape.setAttributeNS(null, 'r', 100);
|
||||||
|
|
||||||
let clipPath = document.createElementNS(svgns, 'clipPath');
|
let clipPath = document.createElementNS(svgns, 'clipPath');
|
||||||
clipPath.setAttributeNS(null, 'id', `${troopAllegiance}-${troopNumber}`);
|
clipPath.setAttributeNS(null, 'id', `clip-path-${troopAllegiance}-${troopNumber}`);
|
||||||
clipPath.dataset.troopNumber = troopNumber;
|
clipPath.dataset.troopNumber = troopNumber;
|
||||||
clipPath.dataset.troopAllegiance = troopAllegiance;
|
clipPath.dataset.troopAllegiance = troopAllegiance;
|
||||||
clipPath.appendChild(clipShape);
|
clipPath.appendChild(clipShape);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user