Files
notifications-admin/app/assets/js/uswds-init.js
Jonathan Bobel f342e0fb6c Updating site to use USWDS styles (#509)
* Updated header and footer
* Updated fonts
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Adjusted grid templating
* Added images to assets
* Update app/templates/components/uk_components/footer/template.njk

Co-authored-by: Steven Reilly <stvnrlly@users.noreply.github.com>
2023-06-06 15:28:24 -04:00

25 lines
563 B
JavaScript

/* eslint-disable no-var */
(function uswdsInit() {
"use strict";
var loadingClass = "usa-js-loading";
var fallback;
document.documentElement.classList.add(loadingClass);
function revertClass() {
document.documentElement.classList.remove(loadingClass);
}
fallback = setTimeout(revertClass, 8000);
function verifyLoaded() {
if (window.uswdsPresent) {
clearTimeout(fallback);
revertClass();
window.removeEventListener("load", verifyLoaded, true);
}
}
window.addEventListener("load", verifyLoaded, true);
})();