diff options
Diffstat (limited to 'app/assets/javascripts/lazy_loader.js')
-rw-r--r-- | app/assets/javascripts/lazy_loader.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/lazy_loader.js b/app/assets/javascripts/lazy_loader.js index 61b4862b4e3..af50ea9d6c2 100644 --- a/app/assets/javascripts/lazy_loader.js +++ b/app/assets/javascripts/lazy_loader.js @@ -19,7 +19,7 @@ export default class LazyLoader { } searchLazyImages() { - requestIdleCallback( + window.requestIdleCallback( () => { const lazyImages = [].slice.call(document.querySelectorAll('.lazy')); @@ -107,7 +107,7 @@ export default class LazyLoader { } scrollCheck() { - requestAnimationFrame(() => this.checkElementsInView()); + window.requestAnimationFrame(() => this.checkElementsInView()); } checkElementsInView() { @@ -122,7 +122,7 @@ export default class LazyLoader { const imgBound = imgTop + imgBoundRect.height; if (scrollTop <= imgBound && visHeight >= imgTop) { - requestAnimationFrame(() => { + window.requestAnimationFrame(() => { LazyLoader.loadImage(selectedImage); }); return false; |