Skip to content

Commit

Permalink
Update JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisdano committed Jan 15, 2025
1 parent 4536986 commit 98360b3
Show file tree
Hide file tree
Showing 6 changed files with 7,221 additions and 0 deletions.
24 changes: 24 additions & 0 deletions assets/uswds/js/uswds-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* 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);
})();
2 changes: 2 additions & 0 deletions assets/uswds/js/uswds-init.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/uswds/js/uswds-init.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 98360b3

Please sign in to comment.