aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts')
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
index fe084afd9..d4402dd9f 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
@@ -20,6 +20,7 @@ export class VideosListMarkupComponent implements OnInit {
20 @Input() count: number 20 @Input() count: number
21 @Input() onlyDisplayTitle: boolean 21 @Input() onlyDisplayTitle: boolean
22 @Input() filter: VideoFilter 22 @Input() filter: VideoFilter
23 @Input() maxRows: number
23 24
24 videos: Video[] 25 videos: Video[]
25 26
@@ -43,6 +44,16 @@ export class VideosListMarkupComponent implements OnInit {
43 return this.auth.getUser() 44 return this.auth.getUser()
44 } 45 }
45 46
47 limitRowsStyle () {
48 if (this.maxRows <= 0) return {}
49
50 return {
51 'grid-template-rows': `repeat(${this.maxRows}, 1fr)`,
52 'grid-auto-rows': '0', // Set height to 0 for autogenerated grid rows
53 'overflow-y': 'hidden' // Hide grid items that overflow
54 }
55 }
56
46 ngOnInit () { 57 ngOnInit () {
47 if (this.onlyDisplayTitle) { 58 if (this.onlyDisplayTitle) {
48 for (const key of Object.keys(this.displayOptions)) { 59 for (const key of Object.keys(this.displayOptions)) {