refactor(docs-infra): simplify condition for determining sidenav mode (#42747)

Previously, the `AppComponent#showTopMenu` property was taken into
account when determining the `MatSidenav#mode` value. However, this was
redundant, because in the only case in which the use of `showTopMenu`
would make a difference (i.e. when `dockSideNav` was true and
`isSideNavDoc` was false) the sidenav would be closed and the hamburger
menu button would not be visible (thus there would be no way to open it
manually).

This commit simplifies the condition for determining the sidenav mode by
removing `showTopMenu` from the expression.

PR Close #42747
This commit is contained in:
George Kalpakas 2021-07-02 13:31:44 +03:00 committed by atscott
parent ffeea63f43
commit 5aecf265f3
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ export class AppComponent implements OnInit {
private currentUrl: string;
get isOpened() { return this.dockSideNav && this.isSideNavDoc; }
get mode() { return this.dockSideNav && (this.isSideNavDoc || this.showTopMenu) ? 'side' : 'over'; }
get mode() { return this.isOpened ? 'side' : 'over'; }
// Search related properties
showSearchResults = false;