1// Mobile navigation toggle 2const toggle = document.getElementById('mobileToggle'); 3const nav = document.getElementById('mainNav'); 4 5if (toggle && nav) { 6 toggle.addEventListener('click', (e) => { 7 e.stopPropagation(); 8 const isOpen = nav.classList.toggle('open'); 9 toggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false'); 10 document.body.style.overflow = isOpen ? 'hidden' : ''; 11 }); 12 13 // Close menu when a link is clicked 14 nav.querySelectorAll('a').forEach(link => { 15 link.addEventListener('click', () => { 16 nav.classList.remove('open'); 17 toggle.setAttribute('aria-expanded', 'false'); 18 document.body.style.overflow = ''; 19 }); 20 }); 21 22 // Close menu when clicking outside 23 document.addEventListener('click', (e) => { 24 if (nav.classList.contains('open') && !nav.contains(e.target) && !toggle.contains(e.target)) { 25 nav.classList.remove('open'); 26 toggle.setAttribute('aria-expanded', 'false'); 27 document.body.style.overflow = ''; 28 } 29 }); 30 31 // Close on Escape key 32 document.addEventListener('keydown', (e) => { 33 if (e.key === 'Escape' && nav.classList.contains('open')) { 34 nav.classList.remove('open'); 35 toggle.setAttribute('aria-expanded', 'false'); 36 document.body.style.overflow = ''; 37 } 38 }); 39}
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.