diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-11-26 16:44:22 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-11-26 16:44:22 +0000 |
commit | 15b4a8f93aaf313b8197ca381f529b00bd231a20 (patch) | |
tree | 774a24e01f608291e80ff35b8876bbb8c653b9bd /app | |
parent | cae50e42e7ead68cfd00b7761f1b7f5572d87148 (diff) | |
parent | ab83c1e419b25436e76ed94f06e056f0bb1f4d53 (diff) | |
download | gitlab-ce-15b4a8f93aaf313b8197ca381f529b00bd231a20.tar.gz |
Merge branch '54407-fix-limited-intersection-observers' into 'master'
Fix Image Lazy Loader for some older browsers
Closes #54407
See merge request gitlab-org/gitlab-ce!23349
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lazy_loader.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/assets/javascripts/lazy_loader.js b/app/assets/javascripts/lazy_loader.js index af50ea9d6c2..ee01a73a6e8 100644 --- a/app/assets/javascripts/lazy_loader.js +++ b/app/assets/javascripts/lazy_loader.js @@ -91,7 +91,9 @@ export default class LazyLoader { onIntersection = entries => { entries.forEach(entry => { - if (entry.isIntersecting) { + // We are using `intersectionRatio > 0` over `isIntersecting`, as some browsers did not ship the latter + // See: https://gitlab.com/gitlab-org/gitlab-ce/issues/54407 + if (entry.intersectionRatio > 0) { this.intersectionObserver.unobserve(entry.target); this.lazyImages.push(entry.target); } |