dfe-frontend
Version:
DfE frontend contains the code you need to design DfE Branded services on top of the GOVUK Design System.
1 lines • 1.65 kB
JavaScript
(()=>{var e={621:()=>{NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(e){return this.filter((function(t){return t===e})).length>0}}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,r),c.exports}(()=>{"use strict";var e=function(e,t){if(e&&t){var r="true"===e.getAttribute(t)?"false":"true";e.setAttribute(t,r)}};r(621),document.addEventListener("DOMContentLoaded",(function(){var t,r,o,n;t=document.querySelector("#toggle-menu"),r=document.querySelector("#close-menu"),o=document.querySelector("#header-navigation"),n=function(r){r.preventDefault(),e(t,"aria-expanded"),t.classList.toggle("is-active"),o.classList.toggle("js-show")},t&&r&&o&&[t,r].forEach((function(e){e.addEventListener("click",n)})),function(){var t=document.querySelector("#toggle-search"),r=document.querySelector("#close-search"),o=document.querySelector("#wrap-search"),n=document.querySelector("#content-header"),c=function(r){r.preventDefault(),e(t,"aria-expanded"),t.classList.toggle("is-active"),o.classList.toggle("js-show"),n.classList.toggle("js-show")};t&&r&&[t,r].forEach((function(e){e.addEventListener("click",c)}))}()}))})()})();