Commit 8d114964 authored by Denys Mishunov's avatar Denys Mishunov

Correctly positioned the is-above flyouts

Changelog: fixed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65735
parent 7c587fbd
...@@ -88,12 +88,12 @@ export const moveSubItemsToPosition = (el, subItems) => { ...@@ -88,12 +88,12 @@ export const moveSubItemsToPosition = (el, subItems) => {
const boundingRect = el.getBoundingClientRect(); const boundingRect = el.getBoundingClientRect();
const left = sidebar ? sidebar.offsetWidth : COLLAPSED_PANEL_WIDTH; const left = sidebar ? sidebar.offsetWidth : COLLAPSED_PANEL_WIDTH;
let top = calculateTop(boundingRect, subItems.offsetHeight); let top = calculateTop(boundingRect, subItems.offsetHeight);
const isAbove = top < boundingRect.top;
if (hasSubItems) { if (hasSubItems) {
top -= header.offsetHeight; top = isAbove ? top : top - header.offsetHeight;
} else { } else {
top = boundingRect.top; top = boundingRect.top;
} }
const isAbove = top <= boundingRect.top;
subItems.classList.add('fly-out-list'); subItems.classList.add('fly-out-list');
subItems.style.transform = `translate3d(${left}px, ${Math.floor(top) - getHeaderHeight()}px, 0)`; // eslint-disable-line no-param-reassign subItems.style.transform = `translate3d(${left}px, ${Math.floor(top) - getHeaderHeight()}px, 0)`; // eslint-disable-line no-param-reassign
......
...@@ -316,6 +316,10 @@ ...@@ -316,6 +316,10 @@
a.has-sub-items + .sidebar-sub-level-items.fly-out-list { a.has-sub-items + .sidebar-sub-level-items.fly-out-list {
@include gl-mt-n2; @include gl-mt-n2;
&.is-above {
@include gl-mt-2;
}
} }
@media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, xl) - 1px) { @media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, xl) - 1px) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment