1const isEditMode = document.querySelectorAll('.sv-edit-mode').length > 0; 2let timeout = 1000; 3const expandArea = document.querySelector('.val-hero-area-expand'); 4 5if (!isEditMode) { 6 expandArea.setAttribute('inert', true); 7 timeout = 0; 8} 9 10const disabled = document.head.querySelector("meta[property='hero.area.expand.setting']").content === 'Nej'; 11if (disabled) { 12 setTimeout(() => { 13 if (expandArea) { 14 expandArea.remove(); 15 } 16 }, timeout) 17} else { 18 const expandButton = document.querySelector('#expand'); 19 20 if (expandButton) { 21 expandButton.setAttribute('aria-controls', expandArea.id); 22 } 23 24 expandButton.addEventListener('click', (e) => { 25 const btn = e.target; 26 if (JSON.stringify(expandArea.classList).includes('active')) { 27 btn.innerText = btn.dataset.openText; 28 btn.classList.remove('active'); 29 btn.setAttribute('aria-expanded', 'false'); 30 expandArea.classList.remove('active'); 31 expandArea.setAttribute('inert', true); 32 } else { 33 btn.innerText = btn.dataset.closeText; 34 btn.classList.add('active'); 35 btn.setAttribute('aria-expanded', 'true'); 36 expandArea.classList.add('active'); 37 expandArea.removeAttribute('inert'); 38 } 39 }); 40}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.