feat(aio): don't animate sidenav on launch.

This commit is contained in:
Ward Bell
2017-04-24 17:15:11 -07:00
committed by Pete Bacon Darwin
parent e7c37d77a8
commit 11b2f62ed2
3 changed files with 16 additions and 4 deletions

View File

@ -10,7 +10,7 @@
</md-toolbar>
<a id="top-of-page"></a>
<md-sidenav-container class="sidenav-container" role="main">
<md-sidenav-container class="sidenav-container" [class.starting]="isStarting" role="main">
<md-sidenav [ngClass]="{'collapsed': !isSideBySide }" #sidenav class="sidenav" [opened]="isOpened" [mode]="mode">
<aio-nav-menu *ngIf="!isSideBySide" class="top-menu" [nodes]="topMenuNodes" [currentNode]="currentNode"></aio-nav-menu>

View File

@ -25,6 +25,7 @@ export class AppComponent implements OnInit {
pageId: string;
currentDocument: DocumentContents;
footerNodes: NavigationNode[];
isStarting = true;
isSideBySide = false;
private isSideNavDoc = false;
private previousNavView: string;
@ -105,9 +106,9 @@ export class AppComponent implements OnInit {
}
onDocRendered() {
// This handler is needed because the subscription to the `currentUrl` in `ngOnInit`
// gets triggered too early before the doc-viewer has finished rendering the doc
// Scroll after the doc-viewer has finished rendering the new doc
this.autoScroll();
this.isStarting = false;
}
@HostListener('window:resize', ['$event.target.innerWidth'])