Web Dev Solutions

Catalin Mititiuc

From ccb1cb2c7573364732a277f0c7c770de611aeca3 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Wed, 10 Jul 2024 22:41:28 -0700 Subject: Allow generic maps to be still generated --- src/modules/scenario.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/modules/scenario.js') 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); -- cgit v1.2.3