From 18ff86840c6403c1cc5424b9ef86e7403227607e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sun, 18 Feb 2024 17:24:10 +0100 Subject: [PATCH] Delete Conditions --- .../scriptaccount-condition-editor.component.html | 2 +- .../scriptaccount-condition-editor.component.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html b/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html index 6d3470a..530a0fa 100644 --- a/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html +++ b/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.html @@ -47,7 +47,7 @@ - + diff --git a/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.ts b/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.ts index 62c0fa6..61e81fc 100644 --- a/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.ts +++ b/src/app/editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component.ts @@ -48,4 +48,14 @@ export class ScriptaccountConditionEditorComponent implements OnInit{ edit(condition: ScriptAccountCondition) { this.editedCondition = condition; } + + deleteCondition(condition: ScriptAccountCondition) { + if(this.addedCondition === condition) { + this.addedCondition = undefined; + this.dataSource.data = this.conditions.concat(); + } else { + this.onDeleteCondition.emit(condition); + this.dataSource.data = this.conditions.concat(); + } + } }