From: Bastian Dehn Date: Mon, 6 Jun 2022 11:54:12 +0000 (+0200) Subject: change: disable buttons contitions X-Git-Tag: v1.0^2~44 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=150935afeaaac2330e4e329b1059e4b75b897843;p=speisekarten-editor.git change: disable buttons contitions --- diff --git a/src/app/app.component.html b/src/app/app.component.html index 9a712ea..5f965b8 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -5,10 +5,12 @@
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 900d1a4..9eeab51 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -41,6 +41,26 @@ export class AppComponent this.formFoodVisible = !this.formFoodVisible; } + public disableFoodButton(): boolean + { + if (this.foodcard.Titles.length < 1) + return true; + + let lastTitle = this.getLastTitle(); + if (lastTitle.Subtitles.length < 1) + return true; + + return false; + } + + public disableSubtitleButton(): boolean + { + if (this.foodcard.Titles.length < 1) + return true; + + return false; + } + public addTitle(): void { this.foodcard.Titles.push({