confirmacion.component.ts 1.17 KB
import { Component, OnInit, HostListener } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service';
import { Subject } from 'rxjs';
import { APP_SETTINGS } from 'src/etc/AppSettings';

@Component({
  selector: 'app-confirmacion',
  templateUrl: './confirmacion.component.html',
  styleUrls: ['./confirmacion.component.scss']
})
export class ConfirmacionComponent implements OnInit {
  titleMessage: string;
  imagenPath: any;
  footerMessageFirst: string;
  footerMessageSecond: string;
  footerConfirmation: number;
  footerClose: string;
  onClose: Subject<any>;
  urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`;

  constructor(
    public modalRef: BsModalRef,
    private inactiveScreen: InactiveScreenService,
  ) {
    this.onClose = new Subject();
  }

  ngOnInit() {
  }

  confirmar() {
    this.onClose.next();
    this.modalRef.hide();
  }

  close() {
    this.modalRef.hide();
  }

  @HostListener('document:click', ['$event'])
  eventListener(event: Event) {
    clearTimeout(this.inactiveScreen.timerReposo);
    this.inactiveScreen.startTimeOutInactividad();
  }
}