#23 Run script directly if page already loaded #24
1 changed files with 2 additions and 1 deletions
|
@ -32,7 +32,8 @@ function findPreloader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function runAfterLoad(func, pattern = '.*') {
|
function runAfterLoad(func, pattern = '.*') {
|
||||||
if (findPreloader()) {
|
let preloader = findPreloader();
|
||||||
|
if (typeof preloader !== undefined && preloader.style.display !== "none") {
|
||||||
__afterLoadScripts.push({ "function": func, "pattern": pattern });
|
__afterLoadScripts.push({ "function": func, "pattern": pattern });
|
||||||
} else {
|
} else {
|
||||||
func();
|
func();
|
||||||
|
|
Loading…
Add table
Reference in a new issue