generated from uswds/uswds-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4536986
commit 98360b3
Showing
6 changed files
with
7,221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.