Delete SimpleTransitions
All checks were successful
E2E Testing / test (push) Successful in 1m26s

This commit is contained in:
Sebastian Böckelmann 2024-02-10 12:52:48 +01:00
parent b730cc1d00
commit d191c28505
2 changed files with 8 additions and 1 deletions

View File

@ -51,7 +51,7 @@
<ng-container matColumnDef="delete"> <ng-container matColumnDef="delete">
<th mat-header-cell *matHeaderCellDef></th> <th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let transition"> <td mat-cell *matCellDef="let transition">
<button mat-icon-button color="warn"><mat-icon>delete</mat-icon></button> <button mat-icon-button color="warn" (click)="deleteTransition(transition)"><mat-icon>delete</mat-icon></button>
</td> </td>
</ng-container> </ng-container>

View File

@ -76,4 +76,11 @@ export class SimpleTransitionEditorComponent implements OnInit {
this.dataSource.data = this.gamesystem!.transitions; this.dataSource.data = this.gamesystem!.transitions;
this.editedTransition = undefined; this.editedTransition = undefined;
} }
deleteTransition(transition: SimpleTransition) {
if(this.gamesystem!.parentGamesystem == undefined) {
this.gamesystem!.removeTransition(transition);
this.dataSource.data = this.gamesystem!.transitions;
}
}
} }