diff options
Diffstat (limited to 'client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts')
-rw-r--r-- | client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts index d084a4908..07c33030a 100644 --- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
3 | import { FormReactive } from '@app/shared' | 2 | import { FormReactive } from '@app/shared' |
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 3 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
5 | import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service' | 4 | import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service' |
6 | import { ServerService } from '@app/core' | 5 | import { ServerService } from '@app/core' |
7 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | 6 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' |
7 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | ||
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-video-caption-add-modal', | 10 | selector: 'my-video-caption-add-modal', |
@@ -17,14 +17,16 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni | |||
17 | 17 | ||
18 | @Output() captionAdded = new EventEmitter<VideoCaptionEdit>() | 18 | @Output() captionAdded = new EventEmitter<VideoCaptionEdit>() |
19 | 19 | ||
20 | @ViewChild('modal') modal: ModalDirective | 20 | @ViewChild('modal') modal: ElementRef |
21 | 21 | ||
22 | videoCaptionLanguages = [] | 22 | videoCaptionLanguages = [] |
23 | 23 | ||
24 | private openedModal: NgbModalRef | ||
24 | private closingModal = false | 25 | private closingModal = false |
25 | 26 | ||
26 | constructor ( | 27 | constructor ( |
27 | protected formValidatorService: FormValidatorService, | 28 | protected formValidatorService: FormValidatorService, |
29 | private modalService: NgbModal, | ||
28 | private serverService: ServerService, | 30 | private serverService: ServerService, |
29 | private videoCaptionsValidatorsService: VideoCaptionsValidatorsService | 31 | private videoCaptionsValidatorsService: VideoCaptionsValidatorsService |
30 | ) { | 32 | ) { |
@@ -51,13 +53,12 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni | |||
51 | show () { | 53 | show () { |
52 | this.closingModal = false | 54 | this.closingModal = false |
53 | 55 | ||
54 | this.modal.show() | 56 | this.openedModal = this.modalService.open(this.modal, { keyboard: false }) |
55 | } | 57 | } |
56 | 58 | ||
57 | hide () { | 59 | hide () { |
58 | this.closingModal = true | 60 | this.closingModal = true |
59 | 61 | this.openedModal.close() | |
60 | this.modal.hide() | ||
61 | } | 62 | } |
62 | 63 | ||
63 | isReplacingExistingCaption () { | 64 | isReplacingExistingCaption () { |