diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/modal/video-support.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/modal/video-support.component.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts new file mode 100644 index 000000000..f805215b9 --- /dev/null +++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts | |||
@@ -0,0 +1,36 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | ||
2 | import { MarkdownService } from '@app/videos/shared' | ||
3 | |||
4 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
5 | import { VideoDetails } from '../../../shared/video/video-details.model' | ||
6 | |||
7 | @Component({ | ||
8 | selector: 'my-video-support', | ||
9 | templateUrl: './video-support.component.html', | ||
10 | styleUrls: [ './video-support.component.scss' ] | ||
11 | }) | ||
12 | export class VideoSupportComponent { | ||
13 | @Input() video: VideoDetails = null | ||
14 | |||
15 | @ViewChild('modal') modal: ModalDirective | ||
16 | |||
17 | videoHTMLSupport = '' | ||
18 | |||
19 | constructor (private markdownService: MarkdownService) { | ||
20 | // empty | ||
21 | } | ||
22 | |||
23 | show () { | ||
24 | this.modal.show() | ||
25 | |||
26 | if (this.video.support) { | ||
27 | this.videoHTMLSupport = this.markdownService.enhancedMarkdownToHTML(this.video.support) | ||
28 | } else { | ||
29 | this.videoHTMLSupport = '' | ||
30 | } | ||
31 | } | ||
32 | |||
33 | hide () { | ||
34 | this.modal.hide() | ||
35 | } | ||
36 | } | ||