aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/confirm/confirm.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-16 14:32:15 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-16 14:32:15 +0200
commitdf98563e2104b82b119c00a3cd83cd0dc1242d25 (patch)
treea9720bf01bac9ad5646bd3d3c9bc7653617afdad /client/src/app/core/confirm/confirm.component.ts
parent46757b477c1adb5f98060d15998a3852e18902a6 (diff)
downloadPeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.gz
PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.zst
PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.zip
Use typescript standard and lint all files
Diffstat (limited to 'client/src/app/core/confirm/confirm.component.ts')
-rw-r--r--client/src/app/core/confirm/confirm.component.ts48
1 files changed, 24 insertions, 24 deletions
diff --git a/client/src/app/core/confirm/confirm.component.ts b/client/src/app/core/confirm/confirm.component.ts
index ae42ff68a..066e3fc5f 100644
--- a/client/src/app/core/confirm/confirm.component.ts
+++ b/client/src/app/core/confirm/confirm.component.ts
@@ -1,12 +1,12 @@
1import { Component, HostListener, OnInit, ViewChild } from '@angular/core'; 1import { Component, HostListener, OnInit, ViewChild } from '@angular/core'
2 2
3import { ModalDirective } from 'ngx-bootstrap/modal'; 3import { ModalDirective } from 'ngx-bootstrap/modal'
4 4
5import { ConfirmService } from './confirm.service'; 5import { ConfirmService } from './confirm.service'
6 6
7export interface ConfigChangedEvent { 7export interface ConfigChangedEvent {
8 columns: { [id: string]: { isDisplayed: boolean }; }; 8 columns: { [id: string]: { isDisplayed: boolean } }
9 config: { resultsPerPage: number }; 9 config: { resultsPerPage: number }
10} 10}
11 11
12@Component({ 12@Component({
@@ -14,48 +14,48 @@ export interface ConfigChangedEvent {
14 templateUrl: './confirm.component.html' 14 templateUrl: './confirm.component.html'
15}) 15})
16export class ConfirmComponent implements OnInit { 16export class ConfirmComponent implements OnInit {
17 @ViewChild('confirmModal') confirmModal: ModalDirective; 17 @ViewChild('confirmModal') confirmModal: ModalDirective
18 18
19 title = ''; 19 title = ''
20 message = ''; 20 message = ''
21 21
22 constructor (private confirmService: ConfirmService) { 22 constructor (private confirmService: ConfirmService) {
23 // Empty 23 // Empty
24 } 24 }
25 25
26 ngOnInit() { 26 ngOnInit () {
27 this.confirmModal.config = { 27 this.confirmModal.config = {
28 backdrop: 'static', 28 backdrop: 'static',
29 keyboard: false 29 keyboard: false
30 }; 30 }
31 31
32 this.confirmService.showConfirm.subscribe( 32 this.confirmService.showConfirm.subscribe(
33 ({ title, message }) => { 33 ({ title, message }) => {
34 this.title = title; 34 this.title = title
35 this.message = message; 35 this.message = message
36 36
37 this.showModal(); 37 this.showModal()
38 } 38 }
39 ); 39 )
40 } 40 }
41 41
42 @HostListener('keydown.enter') 42 @HostListener('keydown.enter')
43 confirm() { 43 confirm () {
44 this.confirmService.confirmResponse.next(true); 44 this.confirmService.confirmResponse.next(true)
45 this.hideModal(); 45 this.hideModal()
46 } 46 }
47 47
48 @HostListener('keydown.esc') 48 @HostListener('keydown.esc')
49 abort() { 49 abort () {
50 this.confirmService.confirmResponse.next(false); 50 this.confirmService.confirmResponse.next(false)
51 this.hideModal(); 51 this.hideModal()
52 } 52 }
53 53
54 showModal() { 54 showModal () {
55 this.confirmModal.show(); 55 this.confirmModal.show()
56 } 56 }
57 57
58 hideModal() { 58 hideModal () {
59 this.confirmModal.hide(); 59 this.confirmModal.hide()
60 } 60 }
61} 61}