From: Bastian Dehn Date: Thu, 9 Jun 2022 17:41:39 +0000 (+0200) Subject: remove: unused methods in app component X-Git-Tag: v1.0^2~17 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=1881e2c6063cfce5b12268ced707e78e9b428bcf;p=speisekarten-editor.git remove: unused methods in app component --- diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0361665..e59c288 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -17,11 +17,7 @@ export class AppComponent public foodcard: IFoodCard = { Titles: [] }; public title: ITitle = { Title: "", Subtitles: [] }; - public subtitle: ISubtitle = { Subtitle: "", Foods: [] }; - public food: IFood = { Food: "", sideDish: "", price: "" }; public formTitleVisible: boolean = false; - public formSubtitleVisible: boolean = false; - public formFoodVisible: boolean = false; public edit: boolean = false; public downloadJsonHref: SafeUrl = ""; @@ -39,18 +35,6 @@ export class AppComponent { Subtitle: "", Foods: [] }); } - 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) @@ -127,24 +111,6 @@ export class AppComponent this.foodcard.Titles.splice(index, 1); } - public addSubtitle(): void - { - let lastTitle = this.getLastTitle() - lastTitle.Subtitles.push(this.subtitle); - this.subtitle = { Subtitle: "", Foods: [] }; - this.formSubtitleVisible = false; - } - - public insertSubSectionAfter(): void - { - let title = this.foodcard.Titles[this.insertIndicies[0]]; - title.Subtitles.splice(this.insertIndicies[1] + 1, 0, - this.subtitle); - this.subtitle = { Subtitle: "", Foods: [] }; - this.insertIndicies = [ -1, -1, -1 ]; - this.formSubtitleVisible = false; - } - public insertSubSection(title: ITitle, index: number): void { title.Subtitles.splice(index + 1, 0, @@ -155,28 +121,4 @@ export class AppComponent { title.Subtitles.splice(index, 1); } - - public insertNewFood(subtitle: ISubtitle, index: number): void - { - subtitle.Foods.splice(index + 1, 0, - { Food: "", sideDish: "", price: "" }); - } - - public removeFood(subtitle: ISubtitle, foodindex: number): void - { - subtitle.Foods.splice(foodindex, 1); - } - - private getLastTitle(): ITitle - { - let lastIndex = this.foodcard.Titles.length - 1; - return this.foodcard.Titles[lastIndex]; - } - - private getLastSubtitle(): ISubtitle - { - let lastTitle = this.getLastTitle(); - let lastIndex = lastTitle.Subtitles.length - 1; - return lastTitle.Subtitles[lastIndex]; - } }