Removing govuk js

This commit is contained in:
alexjanousekGSA
2025-08-06 17:19:15 -04:00
parent 9d7b2b9076
commit 3a230f15b6
19 changed files with 78 additions and 114 deletions

View File

@@ -1,9 +1,27 @@
window.GOVUK.Frontend.initAll();
// Initialize USWDS components
if (window.uswds) {
window.uswds.init();
}
var showHideContent = new GOVUK.ShowHideContent();
showHideContent.init();
// Initialize custom modules
window.NotifyModules = window.NotifyModules || {};
window.NotifyModules.start = function() {
var modules = document.querySelectorAll('[data-module]');
modules.forEach(function(element) {
var moduleName = element.getAttribute('data-module');
var moduleStarted = element.getAttribute('data-module-started');
$(() => GOVUK.modules.start());
if (!moduleStarted && window.NotifyModules[moduleName]) {
var module = new window.NotifyModules[moduleName]();
if (module.start) {
module.start(element);
}
element.setAttribute('data-module-started', 'true');
}
});
};
$(() => window.NotifyModules.start());
$(() => $('.error-message, .usa-error-message').eq(0).parent('label').next('input').trigger('focus'));