This commit is contained in:
parent
c0bdbd5f40
commit
18ff86840c
@ -47,7 +47,7 @@
|
|||||||
<button mat-icon-button (click)="createCondition()"><mat-icon>add</mat-icon></button>
|
<button mat-icon-button (click)="createCondition()"><mat-icon>add</mat-icon></button>
|
||||||
</th>
|
</th>
|
||||||
<td mat-cell *matCellDef="let condition">
|
<td mat-cell *matCellDef="let condition">
|
||||||
<button mat-icon-button color="warn"><mat-icon>delete</mat-icon></button>
|
<button mat-icon-button color="warn" (click)="deleteCondition(condition)"><mat-icon>delete</mat-icon></button>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -48,4 +48,14 @@ export class ScriptaccountConditionEditorComponent implements OnInit{
|
|||||||
edit(condition: ScriptAccountCondition) {
|
edit(condition: ScriptAccountCondition) {
|
||||||
this.editedCondition = condition;
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user