header.component.ts
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Component, OnInit, HostListener } from '@angular/core';
import { APP_SETTINGS } from 'src/etc/AppSettings';
import { BsModalService } from 'ngx-bootstrap';
import { ConfiguracionComponent } from '../configuracion/configuracion.component';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss']
})
export class HeaderComponent implements OnInit {
private apiDeboSuite : string = APP_SETTINGS.apiDeboSuite;
timer: any;
isShowModalConfiguration = false;
constructor(
private modalService: BsModalService,
) { }
ngOnInit() {
}
@HostListener('document:keydown.Control.Shift.A', ['$event'])
openConfigurationScreen(delay: number = 3000) {
if (this.isShowModalConfiguration) return;
this.modalService.onHide
.subscribe(() => this.isShowModalConfiguration = false);
this.timer = setTimeout(() => {
this.isShowModalConfiguration = true;
this.modalService.show(ConfiguracionComponent, {
class: 'modal-md',
ignoreBackdropClick: true,
});
}, delay);
}
resetCountDown() {
clearTimeout(this.timer);
}
}