mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-09 05:09:39 +00:00
22 lines
658 B
TypeScript
22 lines
658 B
TypeScript
import { AfterViewInit, Component, ElementRef, HostBinding, ViewChild } from '@angular/core'
|
|
|
|
@Component({
|
|
selector: 'app-browse',
|
|
templateUrl: './browse.component.html',
|
|
})
|
|
export class BrowseComponent implements AfterViewInit {
|
|
@HostBinding('class.contents') contents = true
|
|
|
|
@ViewChild('chartSidebarDiv') chartSidebarDiv: ElementRef<HTMLDivElement>
|
|
|
|
ngAfterViewInit(): void {
|
|
this.adjustSidebarWidth()
|
|
window.addEventListener('resize', this.adjustSidebarWidth.bind(this))
|
|
}
|
|
|
|
adjustSidebarWidth() {
|
|
const newWidth = Math.max(310, Math.min(window.innerHeight * 0.4, 512))
|
|
this.chartSidebarDiv.nativeElement.style.width = `${newWidth}px`
|
|
}
|
|
}
|