diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-09 14:55:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-09 14:55:06 +0200 |
commit | 63347a0ff966c7863e5b7431effa1cb0668df893 (patch) | |
tree | 8f89d9b4a73f7157103574c05832eff21e338272 /client/src/app/videos/+video-watch/modal/video-report.component.ts | |
parent | b34a444e291c8ec90b4c2c965f7d0d6904d1faa7 (diff) | |
download | PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.gz PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.zst PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.zip |
Migrate to bootstrap 4 and ng-bootstrap
Diffstat (limited to 'client/src/app/videos/+video-watch/modal/video-report.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/modal/video-report.component.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/client/src/app/videos/+video-watch/modal/video-report.component.ts b/client/src/app/videos/+video-watch/modal/video-report.component.ts index d9768fdac..297afb19f 100644 --- a/client/src/app/videos/+video-watch/modal/video-report.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-report.component.ts | |||
@@ -1,11 +1,12 @@ | |||
1 | import { Component, Input, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, Input, OnInit, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { NotificationsService } from 'angular2-notifications' |
3 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
4 | import { FormReactive, VideoAbuseService } from '../../../shared/index' | 3 | import { FormReactive, VideoAbuseService } from '../../../shared/index' |
5 | import { VideoDetails } from '../../../shared/video/video-details.model' | 4 | import { VideoDetails } from '../../../shared/video/video-details.model' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
8 | import { VideoAbuseValidatorsService } from '@app/shared/forms/form-validators/video-abuse-validators.service' | 7 | import { VideoAbuseValidatorsService } from '@app/shared/forms/form-validators/video-abuse-validators.service' |
8 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
9 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | ||
9 | 10 | ||
10 | @Component({ | 11 | @Component({ |
11 | selector: 'my-video-report', | 12 | selector: 'my-video-report', |
@@ -15,12 +16,15 @@ import { VideoAbuseValidatorsService } from '@app/shared/forms/form-validators/v | |||
15 | export class VideoReportComponent extends FormReactive implements OnInit { | 16 | export class VideoReportComponent extends FormReactive implements OnInit { |
16 | @Input() video: VideoDetails = null | 17 | @Input() video: VideoDetails = null |
17 | 18 | ||
18 | @ViewChild('modal') modal: ModalDirective | 19 | @ViewChild('modal') modal: NgbModal |
19 | 20 | ||
20 | error: string = null | 21 | error: string = null |
21 | 22 | ||
23 | private openedModal: NgbModalRef | ||
24 | |||
22 | constructor ( | 25 | constructor ( |
23 | protected formValidatorService: FormValidatorService, | 26 | protected formValidatorService: FormValidatorService, |
27 | private modalService: NgbModal, | ||
24 | private videoAbuseValidatorsService: VideoAbuseValidatorsService, | 28 | private videoAbuseValidatorsService: VideoAbuseValidatorsService, |
25 | private videoAbuseService: VideoAbuseService, | 29 | private videoAbuseService: VideoAbuseService, |
26 | private notificationsService: NotificationsService, | 30 | private notificationsService: NotificationsService, |
@@ -36,11 +40,12 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
36 | } | 40 | } |
37 | 41 | ||
38 | show () { | 42 | show () { |
39 | this.modal.show() | 43 | this.openedModal = this.modalService.open(this.modal, { keyboard: false }) |
40 | } | 44 | } |
41 | 45 | ||
42 | hide () { | 46 | hide () { |
43 | this.modal.hide() | 47 | this.openedModal.close() |
48 | this.openedModal = null | ||
44 | } | 49 | } |
45 | 50 | ||
46 | report () { | 51 | report () { |