diff options
author | Nevena Bojovic <nenabojov@gmail.com> | 2022-05-19 19:48:47 +0200 |
---|---|---|
committer | Nevena Bojovic <nenabojov@gmail.com> | 2022-05-19 19:48:47 +0200 |
commit | 8f22da6ebd539fa4a219ab4e6265e0d45e02d155 (patch) | |
tree | 3067fce5303c8a204e77c0d56c98c1aed881f3b9 /frontend/src/app/_modals/yes-no-dialog | |
parent | 6aba6287a85492295ba5de0a0cc6501d492a3676 (diff) | |
parent | 1f21329593e94411cac7d5448c119ae746773922 (diff) |
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into redesign
Diffstat (limited to 'frontend/src/app/_modals/yes-no-dialog')
-rw-r--r-- | frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.html | 8 | ||||
-rw-r--r-- | frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.ts | 9 |
2 files changed, 11 insertions, 6 deletions
diff --git a/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.html b/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.html index 06e74093..77e7be42 100644 --- a/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.html +++ b/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.html @@ -1,8 +1,10 @@ <h2 mat-dialog-title class="text-muted">{{data.title}}</h2> <div mat-dialog-content class="mt-4" style="color: rgb(81, 76, 76);"> - {{data.message}} + <form (keydown)="withEnterKey($event)"> + {{data.message}} + </form> </div> <div mat-dialog-actions class="d-flex justify-content-center mt-4"> - <button mat-button cdkFocusInitial (click)="onYesClick()" style="background-color: lightgray;">Da</button> - <button mat-button cdkFocusInitial (click)="onNoClick()" style="background-color: lightgray;">Ne</button> + <button mat-button cdkFocusInitial (click)="onYesClick()" style="background-color: lightgray;">Da</button> + <button mat-button cdkFocusInitial (click)="onNoClick()" style="background-color: lightgray;">Ne</button> </div>
\ No newline at end of file diff --git a/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.ts b/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.ts index de1cdd4f..a7db1e7f 100644 --- a/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.ts +++ b/frontend/src/app/_modals/yes-no-dialog/yes-no-dialog.component.ts @@ -24,10 +24,13 @@ export class YesNoDialogComponent { onNoClick(): void { this.dialogRef.close(); } - onYesClick():void{ + + withEnterKey(keyboardEvent: KeyboardEvent) { + if (keyboardEvent.code == "Enter" || keyboardEvent.code == "NumpadEnter") + this.onYesClick(); + } + onYesClick():void { this.data.yesFunction(); this.dialogRef.close(); } - - } |