diff options
-rw-r--r-- | main.js | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -175,7 +175,7 @@ const menu = document.getElementById('map-menu'); const btn = document.createElement('button'); div.appendChild(btn); btn.type = 'button'; - btn.ariaExpanded = 'false'; + btn.setAttribute('aria-expanded', 'false'); btn.title = 'Byt kartlager'; btn.classList.add('btn', 'btn-light'); @@ -185,14 +185,14 @@ const menu = document.getElementById('map-menu'); const panel = document.getElementById('layer-selection-panel'); btn.onclick = function(event) { - if (btn.ariaExpanded === 'true') { - panel.ariaHidden = 'true'; - btn.ariaExpanded = 'false'; + if (btn.getAttribute('aria-expanded') === 'true') { + panel.setAttribute('aria-hidden', 'true'); + btn.setAttribute('aria-expanded', 'false'); btn.classList.add('btn-light'); btn.classList.remove('btn-dark'); } else { - panel.ariaHidden = 'false'; - btn.ariaExpanded = 'true'; + panel.setAttribute('aria-hidden', 'false'); + btn.setAttribute('aria-expanded', 'true'); btn.classList.add('btn-dark'); btn.classList.remove('btn-light'); } @@ -246,7 +246,7 @@ const menu = document.getElementById('map-menu'); const btn = document.createElement('button'); div.appendChild(btn); btn.type = 'button'; - btn.ariaExpanded = 'false'; + btn.setAttribute('aria-expanded', 'false'); btn.title = 'Visa information'; btn.classList.add('btn', 'btn-light'); @@ -257,12 +257,12 @@ const menu = document.getElementById('map-menu'); const panel = document.getElementById('modal-info'); const modal = new Modal(panel, {}); panel.addEventListener('show.bs.modal', function() { - btn.ariaExpanded = 'true'; + btn.setAttribute('aria-expanded', 'true'); btn.classList.add('btn-dark'); btn.classList.remove('btn-light'); }); panel.addEventListener('hidden.bs.modal', function() { - btn.ariaExpanded = 'false'; + btn.setAttribute('aria-expanded', 'false'); btn.classList.add('btn-light'); btn.classList.remove('btn-dark'); }); @@ -273,7 +273,7 @@ const menu = document.getElementById('map-menu'); })(); /* we're all set, show the control container now */ -container.ariaHidden = 'false'; +container.setAttribute('aria-hidden', 'false'); document.getElementById('layer-topowebb_nedtonad').onchange = function(event) { const layer = event.target.checked ? 'topowebb_nedtonad' : 'topowebb'; |