1(function () { 2 var nav = document.querySelector('.static-nav'); 3 if (!nav) return; 4 var button = nav.querySelector('.static-menu-button'); 5 var menu = nav.querySelector('.nav-links'); 6 if (!button || !menu) return; 7 8 function close() { 9 button.setAttribute('aria-expanded', 'false'); 10 } 11 12 button.addEventListener('click', function () { 13 button.setAttribute('aria-expanded', String(button.getAttribute('aria-expanded') !== 'true')); 14 }); 15 document.addEventListener('keydown', function (event) { 16 if (event.key === 'Escape' && button.getAttribute('aria-expanded') === 'true') { 17 close(); 18 button.focus(); 19 } 20 }); 21 document.addEventListener('click', function (event) { 22 if (!nav.contains(event.target)) close(); 23 }); 24 menu.addEventListener('click', function (event) { 25 if (event.target.closest('a')) close(); 26 }); 27 window.matchMedia('(max-width: 767px)').addEventListener('change', close); 28})();
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.