index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -282,16 +282,11 @@ const FIRING_ARC_SIZE = { } let prevVb = localStorage.getItem('viewBox'); -let recVis = localStorage.getItem('recordsVisibility'); if (prevVb) { svg.setAttributeNS(null, 'viewBox', prevVb); } -if (recVis == 'false') { - recordSheetVisibility.checked = false; -} - let info = document.getElementById('status'); Object.values(settingsPanel.querySelectorAll('fieldset')).forEach(fieldset => { @@ -1110,7 +1105,15 @@ svg.addEventListener('pointerdown', e => { }); recordSheetVisibility.addEventListener('input', e => { - localStorage.setItem('recordsVisibility', recordSheetVisibility.checked); + let divs = document.querySelectorAll('#content div'); + + divs.forEach(d => { + if (recordSheetVisibility.checked) { + d.style.display = d.id == 'record-sheet' ? 'flex' : 'block'; + } else { + d.style.display = 'none'; + } + }); }); document.querySelectorAll('#toggle-firing-arc-vis input').forEach(el => el.addEventListener('input', e => { |