Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-30 21:02:13 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-30 21:08:00 -0700
commit1687e0e790d869fe58f86046f5ee093981670c63 (patch)
tree212e0c3127483ec29774ac237c07e00b26f05086 /src/modules/scenario.js
parent48e7675eb0583e420dac52be341e505331c05b4b (diff)
Ok, hover and firing arc doesn't get stuck at all
Not sure about counters
Diffstat (limited to 'src/modules/scenario.js')
-rw-r--r--src/modules/scenario.js3
1 files changed, 2 insertions, 1 deletions
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)