Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 24e5b86

Browse files
feat: directive compatible with IE :)
1 parent 1419080 commit 24e5b86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/directives/core/lazy/defer-load.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export class DeferLoadDirective implements AfterViewInit, OnDestroy {
118118
}
119119

120120
private isVisible () {
121-
let scrollPosition = this.getScrollPosition();
122-
let elementOffset = this._element.nativeElement.getBoundingClientRect().top + window.scrollY;
121+
const scrollPosition = this.getScrollPosition();
122+
const elementOffset = this._element.nativeElement.getBoundingClientRect().top + (window.scrollY || window.pageYOffset);
123123

124124
return elementOffset <= scrollPosition;
125125
}

0 commit comments

Comments
 (0)