diff --git a/blossom-editor/src/renderer/src/views/article/ArticleIndex.vue b/blossom-editor/src/renderer/src/views/article/ArticleIndex.vue index 90c80b0..36151b6 100644 --- a/blossom-editor/src/renderer/src/views/article/ArticleIndex.vue +++ b/blossom-editor/src/renderer/src/views/article/ArticleIndex.vue @@ -105,9 +105,10 @@ @image="cmw.commandImg()" @link="cmw.commandLink()"> -
+
-
+
@@ -719,6 +720,7 @@ const sycnScroll = (_event: Event | string, _source?: string, _lineno?: number, //#region ----------------------------------------< 编辑器右键 >---------------------------------------- const editorRightMenu = ref({ show: false, clientX: 0, clientY: 0 }) +const rightMenuHeight = 215 const removeListenerRightMenu = () => { document.body.removeEventListener('click', closeEditorRightMenu) @@ -730,8 +732,14 @@ const closeEditorRightMenu = () => { } const handleEditorClickRight = (event: MouseEvent) => { + // editorRightMenu.value = { show: false, clientX: 0, clientY: 0 } - editorRightMenu.value = { show: true, clientX: event.clientX, clientY: event.clientY } + // + let y = event.clientY + if (document.body.clientHeight - event.clientY < rightMenuHeight) { + y = event.clientY - rightMenuHeight + } + editorRightMenu.value = { show: true, clientX: event.clientX, clientY: y } setTimeout(() => { document.body.addEventListener('click', closeEditorRightMenu) }, 100) diff --git a/blossom-editor/src/renderer/src/views/article/ArticleTreeTitle.vue b/blossom-editor/src/renderer/src/views/article/ArticleTreeTitle.vue index 77fa457..ee82873 100644 --- a/blossom-editor/src/renderer/src/views/article/ArticleTreeTitle.vue +++ b/blossom-editor/src/renderer/src/views/article/ArticleTreeTitle.vue @@ -154,6 +154,7 @@ const handlClick = () => { //#region ----------------------------------------< 右键菜单 >-------------------------------------- const rMenu = ref({ show: false, clientX: 0, clientY: 0 }) +const rMenuHeight = 275 onBeforeUnmount(() => { document.body.removeEventListener('click', closeMenuShow) @@ -168,10 +169,9 @@ const closeMenuShow = () => { const handleClickRight = (event: MouseEvent) => { // TODO 固定的菜单高度, 每次增加右键菜单项时需要修改该值 - let menuHeight = 275 let y = event.clientY - if (document.body.clientHeight - event.clientY < menuHeight) { - y = event.clientY - 275 + if (document.body.clientHeight - event.clientY < rMenuHeight) { + y = event.clientY - rMenuHeight } rMenu.value = { show: true, clientX: event.clientX, clientY: y } setTimeout(() => {