]>
Commit | Line | Data |
---|---|---|
07fa4c97 C |
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 | } |