Fix z-index issue with stackable headers [SCI-9428]

This commit is contained in:
Martin Artnik 2023-10-03 16:22:22 +02:00
parent 14a693b697
commit 4ea040cde7
3 changed files with 8 additions and 6 deletions

View file

@ -54,7 +54,6 @@ export default {
this.secondaryNavigation.style.zIndex = 252;
} else {
this.secondaryNavigation.style.boxShadow = 'none';
if (secondaryNavigationTop > 10) this.secondaryNavigation.style.zIndex = 11;
}
if (headerTop - 5 < this.taskSecondaryMenuHeight) { // When secondary navigation touch header

View file

@ -1,4 +1,4 @@
export function isInViewPort(el) {
export default function isInViewPort(el) {
const rect = el.getBoundingClientRect();
return (
@ -6,9 +6,9 @@ export function isInViewPort(el) {
rect.left >= 0 &&
rect.bottom <=
(window.innerHeight ||
document.documentElement.clientHeight) /*or $(window).height() */ &&
document.documentElement.clientHeight) &&
rect.right <=
(window.innerWidth ||
document.documentElement.clientWidth) /*or $(window).width() */
document.documentElement.clientWidth)
);
}

View file

@ -63,7 +63,7 @@
<script>
import { isInViewPort } from './isInViewPort.js';
import isInViewPort from './isInViewPort.js';
export default {
name: 'DropdownMenu',
@ -116,7 +116,10 @@ export default {
updateOpenDirectoin() {
if (!this.showMenu) return;
this.openUp = !isInViewPort(this.$refs.flyout);
this.openUp = false;
this.$nextTick(() => {
this.openUp = !isInViewPort(this.$refs.flyout);
});
}
}
}