issue-5-gamesystems #6
@ -51,7 +51,7 @@
 | 
			
		||||
  <ng-container matColumnDef="delete">
 | 
			
		||||
    <th mat-header-cell *matHeaderCellDef></th>
 | 
			
		||||
    <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>
 | 
			
		||||
  </ng-container>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -76,4 +76,11 @@ export class SimpleTransitionEditorComponent implements OnInit {
 | 
			
		||||
    this.dataSource.data = this.gamesystem!.transitions;
 | 
			
		||||
    this.editedTransition = undefined;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  deleteTransition(transition: SimpleTransition) {
 | 
			
		||||
    if(this.gamesystem!.parentGamesystem == undefined) {
 | 
			
		||||
      this.gamesystem!.removeTransition(transition);
 | 
			
		||||
      this.dataSource.data = this.gamesystem!.transitions;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user