Explorar o código

test if hooksFrame is present

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
745573febe
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      lib/lazy/content/content-lazy-loader.js

+ 6 - 2
lib/lazy/content/content-lazy-loader.js

@@ -59,7 +59,9 @@ this.lazyLoader = this.lazyLoader || (() => {
 					lazyLoadEnd(idleTimeoutId, observer, resolve);
 				}
 			}, options.loadDeferredImagesMaxIdleTime * 1.2);
-			hooksFrame.loadDeferredImagesStart();
+			if (typeof hooksFrame != "undefined") {
+				hooksFrame.loadDeferredImagesStart();
+			}
 		});
 	}
 
@@ -70,7 +72,9 @@ this.lazyLoader = this.lazyLoader || (() => {
 
 	function lazyLoadEnd(idleTimeoutId, observer, resolve) {
 		clearAsyncTimeout(idleTimeoutId);
-		hooksFrame.loadDeferredImagesEnd();
+		if (typeof hooksFrame != "undefined") {
+			hooksFrame.loadDeferredImagesEnd();
+		}
 		setAsyncTimeout(resolve, 100);
 		observer.disconnect();
 	}