mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-09 05:37:36 +08:00
Fix z-index issue with stackable headers [SCI-9428]
This commit is contained in:
parent
14a693b697
commit
4ea040cde7
3 changed files with 8 additions and 6 deletions
|
|
@ -54,7 +54,6 @@ export default {
|
||||||
this.secondaryNavigation.style.zIndex = 252;
|
this.secondaryNavigation.style.zIndex = 252;
|
||||||
} else {
|
} else {
|
||||||
this.secondaryNavigation.style.boxShadow = 'none';
|
this.secondaryNavigation.style.boxShadow = 'none';
|
||||||
if (secondaryNavigationTop > 10) this.secondaryNavigation.style.zIndex = 11;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headerTop - 5 < this.taskSecondaryMenuHeight) { // When secondary navigation touch header
|
if (headerTop - 5 < this.taskSecondaryMenuHeight) { // When secondary navigation touch header
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export function isInViewPort(el) {
|
export default function isInViewPort(el) {
|
||||||
const rect = el.getBoundingClientRect();
|
const rect = el.getBoundingClientRect();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -6,9 +6,9 @@ export function isInViewPort(el) {
|
||||||
rect.left >= 0 &&
|
rect.left >= 0 &&
|
||||||
rect.bottom <=
|
rect.bottom <=
|
||||||
(window.innerHeight ||
|
(window.innerHeight ||
|
||||||
document.documentElement.clientHeight) /*or $(window).height() */ &&
|
document.documentElement.clientHeight) &&
|
||||||
rect.right <=
|
rect.right <=
|
||||||
(window.innerWidth ||
|
(window.innerWidth ||
|
||||||
document.documentElement.clientWidth) /*or $(window).width() */
|
document.documentElement.clientWidth)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { isInViewPort } from './isInViewPort.js';
|
import isInViewPort from './isInViewPort.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DropdownMenu',
|
name: 'DropdownMenu',
|
||||||
|
|
@ -116,7 +116,10 @@ export default {
|
||||||
updateOpenDirectoin() {
|
updateOpenDirectoin() {
|
||||||
if (!this.showMenu) return;
|
if (!this.showMenu) return;
|
||||||
|
|
||||||
this.openUp = !isInViewPort(this.$refs.flyout);
|
this.openUp = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.openUp = !isInViewPort(this.$refs.flyout);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue