diff options
author | Luke Bennett <lbennett@gitlab.com> | 2018-11-26 11:57:21 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-11-26 11:57:21 +0300 |
commit | 1877eb49c0bfe855eca74209441f954c4550ffef (patch) | |
tree | 7bc47b4d007f48f8504ee1d6a4c2329d2324adf5 /app/assets/javascripts | |
parent | ceae9f5211a77333810dfd704823381730eb1791 (diff) |
Attempt to fix lazy loader spec transient failure
Diffstat (limited to 'app/assets/javascripts')
-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; |