aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/abstract-video-list.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-21 17:28:15 +0100
committerChocobozzz <me@florianbigard.com>2018-03-21 17:28:15 +0100
commit1ff8d7d6314b9c6724900d1302c354d128c5d25b (patch)
tree6e17181992e994df390157f30b1016c7b7202b87 /client/src/app/shared/video/abstract-video-list.ts
parentbffbebbe6b33ce306e7ec1b6051f0e51521c0440 (diff)
downloadPeerTube-1ff8d7d6314b9c6724900d1302c354d128c5d25b.tar.gz
PeerTube-1ff8d7d6314b9c6724900d1302c354d128c5d25b.tar.zst
PeerTube-1ff8d7d6314b9c6724900d1302c354d128c5d25b.zip
Fix pagination when videos take all the width
Diffstat (limited to 'client/src/app/shared/video/abstract-video-list.ts')
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index 4a220c93d..c3543cfaa 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -15,7 +15,7 @@ import { Video } from './video.model'
15export abstract class AbstractVideoList implements OnInit, OnDestroy { 15export abstract class AbstractVideoList implements OnInit, OnDestroy {
16 private static LINES_PER_PAGE = 3 16 private static LINES_PER_PAGE = 3
17 17
18 @ViewChild('videoElement') videosElement: ElementRef 18 @ViewChild('videosElement') videosElement: ElementRef
19 @ViewChild(InfiniteScrollerDirective) infiniteScroller: InfiniteScrollerDirective 19 @ViewChild(InfiniteScrollerDirective) infiniteScroller: InfiniteScrollerDirective
20 20
21 pagination: ComponentPagination = { 21 pagination: ComponentPagination = {
@@ -183,6 +183,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
183 183
184 // Video takes all the width 184 // Video takes all the width
185 this.videoWidth = -1 185 this.videoWidth = -1
186 // Same ratios than base width/height
187 this.videoHeight = this.videosElement.nativeElement.offsetWidth * (this.baseVideoHeight / this.baseVideoWidth)
186 this.pageHeight = this.pagination.itemsPerPage * this.videoHeight 188 this.pageHeight = this.pagination.itemsPerPage * this.videoHeight
187 } else { 189 } else {
188 this.videoWidth = this.baseVideoWidth 190 this.videoWidth = this.baseVideoWidth