{
left = left - menuWidth;
}
if (menuHeight + top > height) {
- top = top - menuHeight;
+ if (height - top > top) {
+ $rightMenu
+ .style('height', `${height - top - 30}px`)
+ .style('overflow', 'auto');
+ } else {
+ top =
+ top - menuHeight < 0
+ ? height - event.offsetY - 10
+ : top - menuHeight;
+ let _menuHeight = DEFAULT_MENU_HEIGHT;
+ if (top < 0) {
+ _menuHeight = height - event.offsetY - 10;
+ } else if (_menuHeight + top > height) {
+ _menuHeight = height - top - 30;
+ }
+ $rightMenu
+ .style('height', `${_menuHeight}px`)
+ .style('overflow', 'auto');
+ }
}
$rightMenu
- .style('left', left + 'px')
- .style('top', top + 'px')
+ .style('left', `${left}px`)
+ .style('top', `${top}px`)
.style('visibility', 'visible');
}
};
render() {
- const menuConfig = [
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- {
- component: ,
- },
- ];
return (
{menuConfig.map((item, index) => (
diff --git a/app/assets/modules/Explore/NebulaGraph/Panel/index.less b/app/assets/modules/Explore/NebulaGraph/Panel/index.less
index 8d9c0999..4f1612e7 100644
--- a/app/assets/modules/Explore/NebulaGraph/Panel/index.less
+++ b/app/assets/modules/Explore/NebulaGraph/Panel/index.less
@@ -1,6 +1,8 @@
+@import '~#assets/common.less';
+
.graph-wrap {
position: relative;
- height: calc(100% - 65px);
+ height: calc(100% - @controlHeight);
overflow: hidden;
> .panel {