Web Dev Solutions

Catalin Mititiuc

From 09514b6c0cab3904cb4d5bc6bc8560f2293bed0e Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Tue, 30 Apr 2024 14:12:46 -0700 Subject: Refactor cell event listeners --- src/modules/game/soldier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/game/soldier.js') 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 = [ -- cgit v1.2.3