Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-30 14:12:46 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-30 14:12:46 -0700
commit09514b6c0cab3904cb4d5bc6bc8560f2293bed0e (patch)
treebb69c22c9f077de2af1eb9100806454431b7e02a /src/modules/game
parent82d3a4b415ba920176058d615b697e84a49adabc (diff)
Refactor cell event listeners
Diffstat (limited to 'src/modules/game')
-rw-r--r--src/modules/game/soldier.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/game/soldier.js b/src/modules/game/soldier.js
index b01ed15..c4e9753 100644
--- a/src/modules/game/soldier.js
+++ b/src/modules/game/soldier.js
@@ -45,7 +45,7 @@ export function place(svg, selected, cell) {
let points,
counterNodeList = getCounterAndClones(svg, selected);
- if (counterNodeList.length > 0 && selected.parentElement.hasAttribute('data-x')) {
+ if (counterNodeList.length > 0 && svg.querySelector('.grid').contains(selected)) {
let trace = svg.querySelector(traceSelector(selected));
let prevCoords = [