@dwp/govuk-casa
Version:
Framework for creating basic GOVUK Collect-And-Submit-Applications
1 lines • 1.21 kB
JavaScript
!function(){function i(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{if(!e.attachEvent)throw new Error("This browser does not support modern event listeners");e.attachEvent("on"+t,n)}}"pushState"in window.history&&""===window.location.hash&&window.history.replaceState("",document.title,window.location.pathname+window.location.search);var e=document.getElementById("error-summary-title");e&&e.focus(),i(window,"pageshow",function(e){e.persisted&&window.location.reload()}),GOVUKFrontend.initAll(),document.onreadystatechange=function(){var e,t,n;if("complete"===document.readyState)for(t=0,n=(e=document.querySelectorAll("[data-target]")).length;t<n;t+=1)!function(e){var e=e.getAttribute("name"),t=document.querySelectorAll('[name="'+e+'"]:not([data-target-init-done])'),a=document.querySelectorAll('[name="'+e+'"]');function n(){for(var e,t=0,n=a.length;t<n;t+=1)a[t].getAttribute("data-target")&&(e=document.getElementById(a[t].getAttribute("data-target")),a[t].checked?e.className=e.className.replace(/ *js-hidden/,""):e.className=e.className.replace(/ *js-hidden/,"")+" js-hidden")}for(var o=0,r=t.length;o<r;o+=1)i(t[o],"click",n),t[o].setAttribute("data-target-init-done",!0);n()}(e[t])}}();