Change displayed tab when a new one is opened
All checks were successful
E2E Testing / test (push) Successful in 1m25s
All checks were successful
E2E Testing / test (push) Successful in 1m25s
This commit is contained in:
parent
125b2a7ece
commit
8f45063d4f
@ -1,4 +1,4 @@
|
||||
<mat-tab-group>
|
||||
<mat-tab-group [(selectedIndex)]="activeTab">
|
||||
<mat-tab *ngFor="let modelComponent of gameModelComponents">
|
||||
<ng-template mat-tab-label>
|
||||
<mat-icon class="example-tab-icon unsaved" *ngIf="modelComponent.type === ModelComponentType.SCRIPTACCOUNT" [ngClass]="modelComponent.unsaved? 'unsaved':'saved'">inventory_2</mat-icon>
|
||||
|
@ -15,10 +15,12 @@ import {Transition} from "../game-model/gamesystems/Transition";
|
||||
export class EditorComponent {
|
||||
gameModelComponents: ModelComponent[] = [];
|
||||
@Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter<boolean>();
|
||||
activeTab: number = this.gameModelComponents.length;
|
||||
|
||||
openGameModelComponent(gameModelComponent: ModelComponent) {
|
||||
if(!this.gameModelComponents.includes(gameModelComponent)) {
|
||||
this.gameModelComponents.push(gameModelComponent);
|
||||
this.activeTab = this.gameModelComponents.length;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user