refactor(aio): move window:resize handler into component
This commit is contained in:
parent
eaa04354d5
commit
f600d4e9e4
|
@ -5,7 +5,7 @@
|
|||
<span class="fill-remaining-space"></span>
|
||||
</md-toolbar>
|
||||
|
||||
<md-sidenav-container class="sidenav-container" (window:resize)="onResize($event.target.innerWidth)">
|
||||
<md-sidenav-container class="sidenav-container">
|
||||
|
||||
<md-sidenav #sidenav class="sidenav" [opened]="isSideBySide" [mode] = "isSideBySide ? 'side' : 'over'">
|
||||
<aio-top-menu *ngIf="!isSideBySide" class="small" [nodes]="(navigationViews | async)?.TopBar" [homeImageUrl]="homeImageUrl"></aio-top-menu>
|
||||
|
|
|
@ -43,6 +43,7 @@ export class AppComponent implements OnInit {
|
|||
this.onResize(window.innerWidth);
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event.target.innerWidth'])
|
||||
onResize(width) {
|
||||
this.isSideBySide = width > this.sideBySideWidth;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue