mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-03 13:18:57 -04:00
Removing govuk js
This commit is contained in:
@@ -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'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user