Skip to content
Snippets Groups Projects
Commit 5f85f6a9 authored by Tuukka Turu's avatar Tuukka Turu Committed by Ekaterina Kondareva
Browse files

Minor tweaks to side menu styles

parent e1d76e37
No related branches found
No related tags found
No related merge requests found
...@@ -190,5 +190,11 @@ ...@@ -190,5 +190,11 @@
color: var(--grayscale-black); color: var(--grayscale-black);
padding: 8px 10px 8px 6px !important; padding: 8px 10px 8px 6px !important;
} }
&.is-parent {
.hy-menu-item__parent__icon {
display: none;
}
}
} }
} }
...@@ -57,22 +57,6 @@ export class MenuItemSidebar { ...@@ -57,22 +57,6 @@ export class MenuItemSidebar {
this.isActive = true; this.isActive = true;
} }
// Notify breadcrumbs if item is in active trail.
if (this.inActiveTrail && !this.isActive) {
const currentParent = this.el.parentNode;
this.addBreadcrumb.emit({
url: this.url,
label: currentParent.parentElement.getAttribute('label'),
bid: this.menuLinkId,
});
}
if (this.inActiveTrail) {
const currentParent = this.el.parentNode as any;
if (this.menuType === MenuType.sidepanel) {
currentParent.classList.add('is-open');
}
}
// If current menu item is active, trigger all parent menuLevelContainer // If current menu item is active, trigger all parent menuLevelContainer
// elements in the same active-trail to open the menu. // elements in the same active-trail to open the menu.
if (this.isActive) { if (this.isActive) {
...@@ -110,6 +94,19 @@ export class MenuItemSidebar { ...@@ -110,6 +94,19 @@ export class MenuItemSidebar {
} }
} }
componentDidLoad() {
if (this.inActiveTrail) {
const currentParent = this.el.parentNode as any;
if (this.menuType === MenuType.sidepanel) {
currentParent.classList.add('is-open');
const childList = this.el.querySelector('.hy-menu-level-container') as HTMLElement;
if (childList) {
childList.classList.add('is-open');
}
}
}
}
componentWillRender() { componentWillRender() {
// Assign depth value to current menu item instance; 1st level, 2nd level, etc. // Assign depth value to current menu item instance; 1st level, 2nd level, etc.
this.hasChildren = this.el.getElementsByTagName('hy-menu-level-container').length >= 1; this.hasChildren = this.el.getElementsByTagName('hy-menu-level-container').length >= 1;
......
...@@ -42,11 +42,6 @@ ...@@ -42,11 +42,6 @@
.hy-menu-sidebar__panel-toggle { .hy-menu-sidebar__panel-toggle {
display: flex; display: flex;
} }
// Open sidenav panels. Set background color to non-active items
:not(.is-parent):not(.is-active-item).hy-menu-item-sidebar .hy-menu-item-sidebar--label-container {
background: linear-gradient(270deg, #f5f5f5 0%, #f8f8f8 100%);
}
} }
.hy-menu-sidebar__panel-toggle, .hy-menu-sidebar__panel-toggle,
.hy-menu-sidebar__logo { .hy-menu-sidebar__logo {
...@@ -78,6 +73,12 @@ ...@@ -78,6 +73,12 @@
display: flex; display: flex;
height: auto; height: auto;
width: 100%; width: 100%;
// Open sidenav panels. Set background color to non-active items
:not(.is-parent):not(.in-active-trail):not(.is-active-item).hy-menu-item-sidebar
.hy-menu-item-sidebar--label-container {
background: linear-gradient(270deg, #f5f5f5 0%, #f8f8f8 100%);
}
} }
} }
...@@ -90,6 +91,9 @@ ...@@ -90,6 +91,9 @@
&[aria-hidden='false'] { &[aria-hidden='false'] {
min-height: var(--minHeight); min-height: var(--minHeight);
.hy-menu-item-sidebar.hy-menu-item-sidebar--sidenav.hy-menu-item--level-1.is-parent {
border-bottom: 1px solid var(--brand-main-light) !important;
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment