aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
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
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')
-rw-r--r--client/src/app/shared/video/abstract-video-list.html2
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts4
2 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/video/abstract-video-list.html
index fb7f86852..94a38019d 100644
--- a/client/src/app/shared/video/abstract-video-list.html
+++ b/client/src/app/shared/video/abstract-video-list.html
@@ -9,7 +9,7 @@
9 myInfiniteScroller 9 myInfiniteScroller
10 [pageHeight]="pageHeight" 10 [pageHeight]="pageHeight"
11 (nearOfTop)="onNearOfTop()" (nearOfBottom)="onNearOfBottom()" (pageChanged)="onPageChanged($event)" 11 (nearOfTop)="onNearOfTop()" (nearOfBottom)="onNearOfBottom()" (pageChanged)="onPageChanged($event)"
12 class="videos" #videoElement 12 class="videos" #videosElement
13 > 13 >
14 <div *ngFor="let videos of videoPages" class="videos-page"> 14 <div *ngFor="let videos of videoPages" class="videos-page">
15 <my-video-miniature 15 <my-video-miniature
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