Option to minimize added

This commit is contained in:
piotrpekala7 2020-05-01 23:30:30 +02:00
parent 9e2bc25c01
commit c23892f836
2 changed files with 22 additions and 4 deletions

View File

@ -40,14 +40,20 @@
</mat-tab-group> </mat-tab-group>
<button *ngIf="!isMinimized" style="color:white" mat-icon-button (click)="minimize(true)">
<mat-icon>remove</mat-icon>
</button>
<button *ngIf="isMinimized" style="color:white" mat-icon-button (click)="minimize(false)">
<mat-icon>remove</mat-icon>
</button>
<button style="color:white" mat-icon-button (click)="close()"> <button style="color:white" mat-icon-button (click)="close()">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</div> </div>
<app-log-console [hidden]="!(selected.value===0)" [server]="server" [project]="project"></app-log-console> <app-log-console [hidden]="!(selected.value===0) || isMinimized" [server]="server" [project]="project"></app-log-console>
<div *ngFor="let node of nodes; let index = index"> <div [hidden]="isMinimized" *ngFor="let node of nodes; let index = index">
<app-web-console [hidden]="!(selected.value===(index+1))" [server]="server" [node]="nodes[index]"></app-web-console> <app-web-console [hidden]="!(selected.value===(index+1))" [server]="server" [node]="nodes[index]"></app-web-console>
</div> </div>
</div> </div>

View File

@ -28,6 +28,8 @@ export class ConsoleWrapperComponent implements OnInit {
public isDraggingEnabled: boolean = false; public isDraggingEnabled: boolean = false;
public isLightThemeEnabled: boolean = false; public isLightThemeEnabled: boolean = false;
public isMinimized: boolean = false;
constructor( constructor(
private consoleService: NodeConsoleService, private consoleService: NodeConsoleService,
private themeService: ThemeService private themeService: ThemeService
@ -38,7 +40,7 @@ export class ConsoleWrapperComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.themeService.getActualTheme() === 'light' ? this.isLightThemeEnabled = true : this.isLightThemeEnabled = false; this.themeService.getActualTheme() === 'light' ? this.isLightThemeEnabled = true : this.isLightThemeEnabled = false;
this.style = { bottom: '20px', left: '20px', width: '720px', height: '456px'}; this.style = { bottom: '20px', left: '20px', width: '720px', height: '460px'};
this.consoleService.nodeConsoleTrigger.subscribe((node) => { this.consoleService.nodeConsoleTrigger.subscribe((node) => {
this.addTab(node, true); this.addTab(node, true);
@ -50,7 +52,17 @@ export class ConsoleWrapperComponent implements OnInit {
}); });
} }
minimize(value: boolean) {
this.isMinimized = value;
if (!value) {
this.style = { bottom: '20px', left: '20px', width: '720px', height: '460px'};
} else {
this.style = { bottom: '20px', left: '20px', width: '720px', height: '56px'};
}
}
addTab(node: Node, selectAfterAdding: boolean) { addTab(node: Node, selectAfterAdding: boolean) {
this.minimize(false);
this.nodes.push(node); this.nodes.push(node);
if (selectAfterAdding) { if (selectAfterAdding) {
@ -99,7 +111,7 @@ export class ConsoleWrapperComponent implements OnInit {
event.rectangle.width && event.rectangle.width &&
event.rectangle.height && event.rectangle.height &&
(event.rectangle.width < 720 || (event.rectangle.width < 720 ||
event.rectangle.height < 456) event.rectangle.height < 460)
) { ) {
return false; return false;
} }