Skip to content
Snippets Groups Projects
Commit d9692a58 authored by druid's avatar druid
Browse files

fadeout fixes

parent c565595b
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
display: flex; display: flex;
height: 100%; height: 100%;
} }
// First level menu items // First level menu items
.desktop-menu-link { .desktop-menu-link {
background-color: transparent; background-color: transparent;
...@@ -97,7 +98,6 @@ ...@@ -97,7 +98,6 @@
// On hover: heading icon is turned 180deg and grows bigger. // On hover: heading icon is turned 180deg and grows bigger.
&--is-active { &--is-active {
//color: var(--link-blue);
position: relative; position: relative;
&:hover, &:hover,
&:focus { &:focus {
...@@ -135,20 +135,21 @@ ...@@ -135,20 +135,21 @@
// Panel with second level menu items and shortcuts. // Panel with second level menu items and shortcuts.
.hy-desktop-menu-panel { .hy-desktop-menu-panel {
display: flex; display: none;
flex-direction: row; flex-direction: row;
opacity: 0; opacity: 0;
transition: none; transition: none;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
z-index: 510;
width: 100%;
&--is-active { &--is-active {
background: radial-gradient(circle, var(--grayscale-light) 0%, var(--grayscale-background-box) 100%); background: radial-gradient(circle, var(--grayscale-light) 0%, var(--grayscale-background-box) 100%);
box-shadow: 0 0 20px 0 rgba(14, 104, 139, 0.1) inset; box-shadow: 0 0 20px 0 rgba(14, 104, 139, 0.1) inset;
display: flex;
padding-left: 300px; padding-left: 300px;
width: 100%;
z-index: 510;
} }
&__panel-toggle { &__panel-toggle {
......
...@@ -45,6 +45,7 @@ export class HyDesktopMenuLinks { ...@@ -45,6 +45,7 @@ export class HyDesktopMenuLinks {
private _headerBorderOffset: number = 0; private _headerBorderOffset: number = 0;
private _hoverTimer = null; private _hoverTimer = null;
private _fadeOutTimer = null;
@Watch('dataDesktopLinks') @Watch('dataDesktopLinks')
dataDesktopLinksWatcher(data: DesktopLinks[] | string) { dataDesktopLinksWatcher(data: DesktopLinks[] | string) {
...@@ -74,20 +75,7 @@ export class HyDesktopMenuLinks { ...@@ -74,20 +75,7 @@ export class HyDesktopMenuLinks {
// Close menu lang menu if it's open // Close menu lang menu if it's open
this.menuDesktopToggled.emit(); this.menuDesktopToggled.emit();
/* clearTimeout(this._fadeOutTimer);
@Listen('handleClick', {capture: true}) handleClick() {
this.menuContainerToggled.emit({
triggerItem: this.menuLinkId,
triggerType: 'add',
});
const currentParent = this.el.parentNode;
this.addBreadcrumb.emit({
url: this.url,
label: currentParent.parentElement.getAttribute('label'),
bid: this.menuLinkId,
});
}
*/
// Open desktop menu panel // Open desktop menu panel
this.isDesktopMenuOpen = true; this.isDesktopMenuOpen = true;
...@@ -189,15 +177,24 @@ export class HyDesktopMenuLinks { ...@@ -189,15 +177,24 @@ export class HyDesktopMenuLinks {
item.setAttribute('aria-expanded', 'false'); item.setAttribute('aria-expanded', 'false');
}); });
menuPanelItems.forEach((item) => { if (fadeOut) {
item.classList.remove('hy-desktop-menu-panel--is-active'); menuPanelItems.forEach((item) => {
item.setAttribute('aria-hidden', 'true'); (item as HTMLElement).style.opacity = '0';
(item as HTMLElement).style.opacity = '0';
if (fadeOut) {
(item as HTMLElement).style.transition = 'opacity 1s'; (item as HTMLElement).style.transition = 'opacity 1s';
} });
});
this._fadeOutTimer = setTimeout(() => {
menuPanelItems.forEach((item) => {
item.classList.remove('hy-desktop-menu-panel--is-active');
item.setAttribute('aria-hidden', 'true');
});
}, 2500);
} else {
menuPanelItems.forEach((item) => {
item.classList.remove('hy-desktop-menu-panel--is-active');
item.setAttribute('aria-hidden', 'true');
});
}
} }
handleDesktopMenuClose(event) { handleDesktopMenuClose(event) {
......
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