Fix elevation view styles

This commit is contained in:
2025-06-16 22:41:32 -07:00
parent 526cc26240
commit e7aebda9dc
5 changed files with 32 additions and 77 deletions

View File

@@ -208,13 +208,11 @@ document.querySelector('#roll-dice').addEventListener('click', () => {
});
});
// document.querySelectorAll('[name="select-elevation"]').forEach(el => {
// const gameboard = document.querySelector('.gameboard');
// el.addEventListener('change', function (e) {
// gameboard.dataset.viewElevation = this.value
// });
// });
document.querySelectorAll('[name="select-elevation"]').forEach(el => {
el.addEventListener('change', function (e) {
document.querySelector('object').contentDocument.querySelector('.grid').dataset.viewElevation = this.value;
});
});
contentVisToggleEl.addEventListener('input', toggleContentVis);
contentVisToggleEl.checked = (localStorage.getItem('content-visibility') !== 'false');

View File

@@ -3,7 +3,7 @@ async function loadScript(scenario, svg, script) {
const scriptEl = document.createElementNS("http://www.w3.org/2000/svg", 'script');
scriptEl.onload = () => {
console.log('map.js loaded');
console.log(`${script}.js loaded`);
resolve();
};
@@ -18,7 +18,6 @@ async function loadScript(scenario, svg, script) {
scriptEl.dataset.cols = dataset.cols;
}
// scriptEl.setAttributeNS(null, 'href', '../../map.js');
scriptEl.setAttributeNS(null, 'href', `../../${script}.js`);
svg.append(scriptEl);
});