]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts
Merge remote-tracking branch 'weblate/develop' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / angular / infinite-scroller.directive.ts
index f09c3d1fc62742244f934b3383d3a67a85a93e3c..d2cf532277c41547cf2aa30061878e8dfa28a862 100644 (file)
@@ -1,6 +1,6 @@
+import { fromEvent, Observable, Subscription } from 'rxjs'
 import { distinctUntilChanged, filter, map, share, startWith, throttleTime } from 'rxjs/operators'
 import { AfterContentChecked, Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'
-import { fromEvent, Observable, Subscription } from 'rxjs'
 
 @Directive({
   selector: '[myInfiniteScroller]'
@@ -80,7 +80,9 @@ export class InfiniteScrollerDirective implements OnInit, OnDestroy, AfterConten
   }
 
   private getMaximumScroll () {
-    return this.container.scrollHeight - window.innerHeight
+    const elementHeight = this.onItself ? this.container.clientHeight : window.innerHeight
+
+    return this.container.scrollHeight - elementHeight
   }
 
   private hasScroll () {