#23 Fix if preloader always hidden

Previous if statement did not work because it still was found in DOM so it only was pushed into the array but not executed.
This commit is contained in:
Serraniel 2020-08-05 12:25:08 +02:00
parent 5f63ecb336
commit 324b3f5c76
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

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();