#23 Run script directly if page already loaded #24

Merged
Serraniel merged 2 commits from bugfix/#23-runAfterLoad-only-works-if-called-before-page-loaded into develop 2020-08-21 16:22:40 +02:00
Showing only changes of commit 324b3f5c76 - Show all commits

View file

@ -32,7 +32,8 @@ function findPreloader() {
}
function runAfterLoad(func, pattern = '.*') {
if (findPreloader()) {
let preloader = findPreloader();
if (typeof preloader !== undefined && preloader.style.display !== "none") {
__afterLoadScripts.push({ "function": func, "pattern": pattern });
} else {
func();