diff options
Diffstat (limited to 'client/src/app/shared/video/infinite-scroller.directive.ts')
-rw-r--r-- | client/src/app/shared/video/infinite-scroller.directive.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/video/infinite-scroller.directive.ts index a02e9444a..186597a3a 100644 --- a/client/src/app/shared/video/infinite-scroller.directive.ts +++ b/client/src/app/shared/video/infinite-scroller.directive.ts | |||
@@ -11,6 +11,7 @@ export class InfiniteScrollerDirective implements OnInit, OnDestroy { | |||
11 | @Input() firstLoadedPage = 1 | 11 | @Input() firstLoadedPage = 1 |
12 | @Input() percentLimit = 70 | 12 | @Input() percentLimit = 70 |
13 | @Input() autoInit = false | 13 | @Input() autoInit = false |
14 | @Input() container = document.body | ||
14 | 15 | ||
15 | @Output() nearOfBottom = new EventEmitter<void>() | 16 | @Output() nearOfBottom = new EventEmitter<void>() |
16 | @Output() nearOfTop = new EventEmitter<void>() | 17 | @Output() nearOfTop = new EventEmitter<void>() |
@@ -48,7 +49,7 @@ export class InfiniteScrollerDirective implements OnInit, OnDestroy { | |||
48 | .pipe( | 49 | .pipe( |
49 | startWith(null), | 50 | startWith(null), |
50 | throttleTime(200, undefined, throttleOptions), | 51 | throttleTime(200, undefined, throttleOptions), |
51 | map(() => ({ current: window.scrollY, maximumScroll: document.body.clientHeight - window.innerHeight })), | 52 | map(() => ({ current: window.scrollY, maximumScroll: this.container.clientHeight - window.innerHeight })), |
52 | distinctUntilChanged((o1, o2) => o1.current === o2.current), | 53 | distinctUntilChanged((o1, o2) => o1.current === o2.current), |
53 | share() | 54 | share() |
54 | ) | 55 | ) |