Sengi-Windows-MacOS-Linux/src/app/components/floating-column/floating-column.component.ts

58 lines
1.8 KiB
TypeScript
Raw Normal View History

2018-09-10 03:55:16 +02:00
import { Component, OnInit } from '@angular/core';
2018-09-22 06:22:51 +02:00
import { NavigationService, LeftPanelType } from '../../services/navigation.service';
2018-09-11 07:54:23 +02:00
import { AccountWrapper } from '../../models/account.models';
2018-09-10 03:55:16 +02:00
@Component({
2018-09-22 06:22:51 +02:00
selector: 'app-floating-column',
templateUrl: './floating-column.component.html',
styleUrls: ['./floating-column.component.scss']
2018-09-10 03:55:16 +02:00
})
export class FloatingColumnComponent implements OnInit {
2018-11-08 05:31:47 +01:00
overlayActive: boolean;
2018-09-22 06:22:51 +02:00
userAccountUsed: AccountWrapper;
2018-09-10 03:55:16 +02:00
2018-09-22 06:22:51 +02:00
openPanel: string;
2018-09-10 03:55:16 +02:00
2018-09-22 06:22:51 +02:00
constructor(private readonly navigationService: NavigationService) { }
ngOnInit() {
this.navigationService.activatedPanelSubject.subscribe((type: LeftPanelType) => {
switch (type) {
case LeftPanelType.Closed:
this.openPanel = '';
break;
case LeftPanelType.AddNewAccount:
this.openPanel = 'addNewAccount';
break;
case LeftPanelType.CreateNewStatus:
this.openPanel = 'createNewStatus';
break;
case LeftPanelType.ManageAccount:
this.userAccountUsed = this.navigationService.getAccountToManage();
this.openPanel = 'manageAccount';
break;
case LeftPanelType.Search:
this.openPanel = 'search';
break;
case LeftPanelType.Settings:
this.openPanel = 'settings';
break;
default:
this.openPanel = '';
}
});
}
closePanel(): boolean {
this.navigationService.closePanel();
return false;
}
2018-09-10 03:55:16 +02:00
2018-11-08 05:31:47 +01:00
closeOverlay(): boolean {
this.overlayActive = false;
return false;
}
2018-09-10 03:55:16 +02:00
}