1document.addEventListener("DOMContentLoaded", function() { 2 const e = document.getElementById("global-header"); 3 const n = document.getElementById("global-header__menu-toggle"); 4 5 function toggleSiteHeader(e, n) { 6 if (e.classList.contains("site-header--toggled")) { 7 e.classList.remove("site-header--toggled"); 8 } else { 9 e.classList.add("site-header--toggled"); 10 } 11 12 const isAriaExpanded = "true" === n.getAttribute("aria-expanded"); 13 const newAriaState = isAriaExpanded ? "false" : "true"; 14 n.setAttribute("aria-expanded", newAriaState); 15 } 16 17 function addEventListenerToElement(element) { 18 if (element !== null && element !== undefined) { 19 element.addEventListener("click", function(event) { 20 toggleSiteHeader(e, n); 21 }); 22 } 23 } 24 25 // Remove the line below to avoid attaching the listener to main content 26 // addEventListenerToElement(mainContentElement); 27 28 addEventListenerToElement(n); 29});
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.