import { Component , OnInit , ElementRef } from '@angular/core' ; @ Component ( { selector : 'app-backstage-topbanner' , templateUrl : './backstage-topbanner.component.html' , styleUrls : [ './backstage-topbanner.component.less' ] } ) export class BackstageTopbannerComponent implements OnInit { isCollapsed = false ; triggerTemplate = null ; sidebarWidth : any = 256 ; tabWidth : any = 0 ; constructor ( private hst ) { } ngOnInit ( ) { } changeTrigger ( ) { } collapsedTrigger ( ) { this . isCollapsed = ! this . isCollapsed ; this . doLayout ( ) ; const e = document . createEvent ( 'Event' ) ; e . initEvent ( 'resize' , true , true ) ; window . dispatchEvent ( e ) ; } tabSize ( n ) { this . tabWidth = n ; } doLayout ( ) { } private smartDetection ( ) { if ( window . innerWidth < 500 ) { this . hst . nativeElement . querySelector ( 'nz-sider' ) . style . display = 'none' ; this . isCollapsed = true ; } else if ( window . innerWidth < 1000 ) { this . hst . nativeElement . querySelector ( 'nz-sider' ) . style . display = '' ; this . isCollapsed = true ; } else { } } }