Skip to content

Commit

Permalink
Fix left-nav flyout (#1376)
Browse files Browse the repository at this point in the history
  • Loading branch information
zarkosimic authored Jun 2, 2020
1 parent ad6a4d5 commit b15e464
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 33 deletions.
41 changes: 30 additions & 11 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions core/src/navigation/services/semi-collapsed-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ class SemiCollapsibleNavigationClass {
? true
: false;
// set this.isSemiCollapsed to true for mobile
let isSemiCollapsedUndefined = this.isSemiCollapsed === undefined;
if (
this.semiCollapsible &&
window.innerWidth !== 0 &&
window.innerWidth < CSS_BREAKPOINTS.desktopMinWidth
) {
this.setCollapsed(true);
this.isSemiCollapsed = isSemiCollapsedUndefined
? true
: this.getCollapsed();
} else {
this.isSemiCollapsed = isSemiCollapsedUndefined
? false
: this.getCollapsed();
}
this.isSemiCollapsed = this.semiCollapsible ? this.getCollapsed() : false;

this.setCollapsed(this.isSemiCollapsed);

this.previousWindowWidth = window.innerWidth;
Expand Down Expand Up @@ -71,7 +78,7 @@ class SemiCollapsibleNavigationClass {
}

getCollapsed() {
return localStorage.getItem(NavigationHelpers.COL_NAV_KEY) === 'true';
return this.isSemiCollapsed;
}

closePopupMenu(selectedCategory) {
Expand Down
Loading

0 comments on commit b15e464

Please sign in to comment.