1export default (hamburgerButton, menubox) => { 2 hamburgerButton.addEventListener('click', (e) => { 3 if (!hamburgerButton.classList.contains('is-active')) { 4 e.stopPropagation(); 5 document.dispatchEvent( 6 new CustomEvent('triggerMenuBox'), 7 ); 8 } 9 10 hamburgerButton.classList.toggle('is-active'); 11 12 if (menubox) { 13 menubox.classList.toggle('isopen'); 14 } 15 }); 16 17 let initDocumentWidth = document.documentElement.clientWidth; 18 19 window.addEventListener('resize', () => { 20 if (initDocumentWidth !== document.documentElement.clientWidth) { 21 hamburgerButton.classList.remove('is-active'); 22 menubox.classList.remove('isopen'); 23 initDocumentWidth = document.documentElement.clientWidth; 24 } 25 }); 26 27 window.addEventListener('click', () => { 28 hamburgerButton.classList.remove('is-active'); 29 menubox.classList.remove('isopen'); 30 }); 31};
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.