From 94da8fba2bd078b25826659a7d5f4291d8be2277 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 8 Oct 2024 17:28:04 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20left=20=E4=B8=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=20https://github.com/siyuan-note/siyuan/pull/12700?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/dialog/tooltip.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/dialog/tooltip.ts b/app/src/dialog/tooltip.ts index 5c632783e..964c20e82 100644 --- a/app/src/dialog/tooltip.ts +++ b/app/src/dialog/tooltip.ts @@ -35,13 +35,12 @@ export const showTooltip = (message: string, target: Element, error = false) => if (position?.startsWith("right")) { // block icon and background icon left = targetRect.right - messageElement.clientWidth; - } else if (position?.startsWith("left")) { - left = targetRect.left; } if (position?.endsWith("bottom")) { top += parseInt(position.replace("right", "").replace("left", "")); } else if (position?.endsWith("top")) { + // 编辑器动态滚动条 top = targetRect.top - messageElement.clientHeight; } else if (position === "parentE") { // file tree and outline、backlink @@ -57,7 +56,7 @@ export const showTooltip = (message: string, target: Element, error = false) => const bottomHeight = window.innerHeight - top; messageElement.style.maxHeight = Math.max(topHeight, bottomHeight) + "px"; - + if (top + messageElement.clientHeight > window.innerHeight && topHeight > bottomHeight) { messageElement.style.top = ((position === "parentE" ? parentRect.bottom : targetRect.top) - messageElement.clientHeight) + "px"; } else {