Web Dev Solutions

Catalin Mititiuc

From 1687e0e790d869fe58f86046f5ee093981670c63 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Tue, 30 Jul 2024 21:02:13 -0700 Subject: Ok, hover and firing arc doesn't get stuck at all Not sure about counters --- src/modules/scenario.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modules/scenario.js') diff --git a/src/modules/scenario.js b/src/modules/scenario.js index 805d0fe..4f72168 100644 --- a/src/modules/scenario.js +++ b/src/modules/scenario.js @@ -97,7 +97,8 @@ export async function build(svg, request) { const scenarioBuildings = scenario.querySelector('.gameboard .buildings'); if (scenarioGrid) { - grid.replaceWith(svg.ownerDocument.importNode(scenarioGrid, true)); + const frontmost = grid.querySelector('.frontmost'); + [...scenarioGrid.children].forEach(child => frontmost.before(svg.ownerDocument.importNode(child, true))); } if (scenarioBuildings) -- cgit v1.2.3