info-formas-pago.component.ts
955 Bytes
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
import { Component, OnInit, TemplateRef, OnDestroy } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
@Component({
selector: 'app-formas-pago',
templateUrl: './info-formas-pago.component.html',
styleUrls: ['./info-formas-pago.component.scss']
})
export class InfoFormasPagoComponent implements OnInit, OnDestroy {
timer: any;
constructor(
private modalService: BsModalService,
) { }
ngOnInit() {
this.mediaPantalla();
}
ngOnDestroy() {
if (this.timer) clearTimeout(this.timer);
}
openGoCaja(templateRef: TemplateRef<any>) {
const modalRef = this.modalService.show(templateRef, { class: 'modal-dialog-centered' });
this.timer = setTimeout(() => {
modalRef.hide();
}, 3000);
}
mediaPantalla() {
if ($('body').hasClass('media-pantalla')) {
$('.reduce-card-1,.reduce-card-2')
.addClass('media-pantalla')
.addBack('media-pantalla');
}
}
}