2023-01-25 13:41:53 +01:00
|
|
|
import {Component} from "@angular/core";
|
2023-01-25 07:00:35 +01:00
|
|
|
import {LayoutService} from "./layout.service";
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: '[sidebar-content]',
|
|
|
|
template: `
|
|
|
|
<div id="sidebar_toggle" (click)="toggleOpen()"></div>
|
|
|
|
<div id="sidebar_content" (mouseenter)="onMouseEnter()" (mouseleave)="onMouseLeave()">
|
|
|
|
<ng-content></ng-content>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class SidebarContentComponent {
|
|
|
|
|
|
|
|
constructor(private layoutService: LayoutService) {
|
|
|
|
}
|
|
|
|
|
|
|
|
onMouseEnter() {
|
|
|
|
this.layoutService.setHover(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
onMouseLeave() {
|
|
|
|
this.layoutService.setHover(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public toggleOpen() {
|
|
|
|
this.layoutService.setOpen(!this.layoutService.open);
|
|
|
|
}
|
|
|
|
}
|