[disabled]="formFoodVisible"
(click)="editFood()">Bearbeiten</button>
- <form #formFood="ngForm" *ngIf="formFoodVisible" class="grid form">
+ <form #formFood="ngForm"
+ *ngIf="formFoodVisible"
+ (keypress)="onKeypressEnter($event)"
+ class="grid form">
<label>Speise</label>
<input [(ngModel)]="food.Food" name="food" type="text" />
<label>Beilage</label>
{
this.formFoodVisible = false;
}
+
+ public onKeypressEnter(e: any): void
+ {
+ if (e.keyCode === 13)
+ this.saveFood();
+ }
}
id="buttonFood"
(click)="addNewFood()">Speise hinzufügen</button>
- <form #formSubtitle="ngForm" *ngIf="formSubtitleVisible" class="form">
+ <form #formSubtitle="ngForm" *ngIf="formSubtitleVisible"
+ (keypress)="onKeypressEnter($event)"
+ class="form">
<label>Untertitel</label>
- <input [(ngModel)]="subtitle.Subtitle" name="subtitle" type="text" />
+ <input [(ngModel)]="subtitle.Subtitle"
+ name="subtitle"
+ type="text" />
<button class="button"
type="button"
id="saveSubtitle"
this.formSubtitleVisible = true;
}
+ public onKeypressEnter(e: any): void
+ {
+ if (e.keyCode === 13)
+ this.saveSubtitle();
+ }
+
public saveSubtitle(): void
{
this.formSubtitleVisible = false;
<button class="button"
type="button"
(click)="editTitle()">Bearbeiten</button>
- <form #formTitle="ngForm" *ngIf="formTitleVisible" class="form">
+ <form #formTitle="ngForm" *ngIf="formTitleVisible"
+ (keypress)="onKeypressEnter($event)"
+ class="form">
<label>Titel</label>
<input [(ngModel)]="title.Title" name="title" type="text" />
<button class="button"
this.formTitleVisible = true;
}
+ public onKeypressEnter(e: any): void
+ {
+ if (e.keyCode === 13)
+ this.saveTitle();
+ }
+
public saveTitle(): void
{
this.formTitleVisible = false;