Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-04-04 15:52:56 -0700
committerCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-04-04 15:52:56 -0700
commit8bd67fbee2575bbcc83a4cf7f03f2c4aa5828b92 (patch)
treef927940fdd4f6229d275e028101d2a784d098488
parentb75a92bfe30450e4c52fe84a63edc23d0b628c53 (diff)
Fix using duplicate ids for counters and clip paths
-rw-r--r--index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.js b/index.js
index ca8f618..7ed64e3 100644
--- a/index.js
+++ b/index.js
@@ -583,7 +583,7 @@ const RecordSheet = new function() {
unclipped.forEach(el => {
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);
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.troopAllegiance = troopAllegiance;
clipPath.appendChild(clipShape);