Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-10 22:41:28 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-10 22:41:28 -0700
commitccb1cb2c7573364732a277f0c7c770de611aeca3 (patch)
treeebbb28f5902a71bbd3028a259ce002988d3b579c /src/modules/scenario.js
parent9c200873d6f013fa1e8eb9f00441404cca9acc1a (diff)
Allow generic maps to be still generated
Diffstat (limited to 'src/modules/scenario.js')
-rw-r--r--src/modules/scenario.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/modules/scenario.js b/src/modules/scenario.js
index 039801d..6ab66db 100644
--- a/src/modules/scenario.js
+++ b/src/modules/scenario.js
@@ -15,11 +15,7 @@ async function loadScript(scenario, svg, script) {
};
const dataset = scenario.querySelector('script')?.dataset || {};
-
- if ('cols' in dataset && 'rows' in dataset) {
- scriptEl.dataset.rows = dataset.rows;
- scriptEl.dataset.cols = dataset.cols;
- }
+ Object.entries(dataset).forEach(([k, v]) => scriptEl.dataset[k] = v);
scriptEl.setAttributeNS(null, 'href', `../../${script}.js`);
svg.append(scriptEl);