delete dossier on enter

This commit is contained in:
Dan Percic 2021-06-15 13:55:22 +03:00
parent e75e9dee85
commit 599e547b03

View File

@ -1,4 +1,4 @@
import { Component, Inject } from '@angular/core';
import { Component, HostListener, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
@ -52,6 +52,13 @@ export class ConfirmationDialogComponent {
this.translate(this._inputLabelKey) + ` '${this.config.confirmationText}'`;
}
@HostListener('window:keyup.enter')
onKeyupEnter() {
if (this.config.requireInput && !this.confirmationDoesNotMatch()) {
this.confirm();
}
}
get isDeleteAction() {
return this.config?.titleColor === TitleColors.PRIMARY;
}