aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-14 14:05:36 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commitbce47964f6241ae56f61089d144b29eb9b5da6d3 (patch)
treecad0a5ef17bc7851d483969453f7b8c2e6edad57 /client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts
parent2a10aab3d7634a252a2acc946974df903e6025be (diff)
downloadPeerTube-bce47964f6241ae56f61089d144b29eb9b5da6d3.tar.gz
PeerTube-bce47964f6241ae56f61089d144b29eb9b5da6d3.tar.zst
PeerTube-bce47964f6241ae56f61089d144b29eb9b5da6d3.zip
Add video channel view
Diffstat (limited to 'client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts')
-rw-r--r--client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts16
1 files changed, 13 insertions, 3 deletions
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts
index c0cfd855d..6cc5b87b4 100644
--- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts
+++ b/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts
@@ -1,4 +1,4 @@
1import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core' 1import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
2import { Video } from '@app/shared/video/video.model' 2import { Video } from '@app/shared/video/video.model'
3import { VideoPlaylistElementUpdate } from '@shared/models' 3import { VideoPlaylistElementUpdate } from '@shared/models'
4import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' 4import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core'
@@ -13,7 +13,8 @@ import { secondsToTime } from '../../../assets/player/utils'
13@Component({ 13@Component({
14 selector: 'my-video-playlist-element-miniature', 14 selector: 'my-video-playlist-element-miniature',
15 styleUrls: [ './video-playlist-element-miniature.component.scss' ], 15 styleUrls: [ './video-playlist-element-miniature.component.scss' ],
16 templateUrl: './video-playlist-element-miniature.component.html' 16 templateUrl: './video-playlist-element-miniature.component.html',
17 changeDetection: ChangeDetectionStrategy.OnPush
17}) 18})
18export class VideoPlaylistElementMiniatureComponent { 19export class VideoPlaylistElementMiniatureComponent {
19 @ViewChild('moreDropdown') moreDropdown: NgbDropdown 20 @ViewChild('moreDropdown') moreDropdown: NgbDropdown
@@ -24,6 +25,7 @@ export class VideoPlaylistElementMiniatureComponent {
24 @Input() playing = false 25 @Input() playing = false
25 @Input() rowLink = false 26 @Input() rowLink = false
26 @Input() accountLink = true 27 @Input() accountLink = true
28 @Input() position: number
27 29
28 @Output() elementRemoved = new EventEmitter<Video>() 30 @Output() elementRemoved = new EventEmitter<Video>()
29 31
@@ -44,7 +46,8 @@ export class VideoPlaylistElementMiniatureComponent {
44 private route: ActivatedRoute, 46 private route: ActivatedRoute,
45 private i18n: I18n, 47 private i18n: I18n,
46 private videoService: VideoService, 48 private videoService: VideoService,
47 private videoPlaylistService: VideoPlaylistService 49 private videoPlaylistService: VideoPlaylistService,
50 private cdr: ChangeDetectorRef
48 ) {} 51 ) {}
49 52
50 buildRouterLink () { 53 buildRouterLink () {
@@ -95,6 +98,8 @@ export class VideoPlaylistElementMiniatureComponent {
95 98
96 video.playlistElement.startTimestamp = body.startTimestamp 99 video.playlistElement.startTimestamp = body.startTimestamp
97 video.playlistElement.stopTimestamp = body.stopTimestamp 100 video.playlistElement.stopTimestamp = body.stopTimestamp
101
102 this.cdr.detectChanges()
98 }, 103 },
99 104
100 err => this.notifier.error(err.message) 105 err => this.notifier.error(err.message)
@@ -145,5 +150,10 @@ export class VideoPlaylistElementMiniatureComponent {
145 this.timestampOptions.stopTimestamp = video.playlistElement.stopTimestamp 150 this.timestampOptions.stopTimestamp = video.playlistElement.stopTimestamp
146 } 151 }
147 } 152 }
153
154 // FIXME: why do we have to use setTimeout here?
155 setTimeout(() => {
156 this.cdr.detectChanges()
157 })
148 } 158 }
149} 159}