From e2f1a82db4d15bf1b53947621455326b8f3e7d7d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 29 Apr 2024 23:30:23 +0800 Subject: [PATCH] :lipstick: tip and memo --- app/src/dialog/tooltip.ts | 7 ++++--- app/src/layout/topBar.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/dialog/tooltip.ts b/app/src/dialog/tooltip.ts index 7c4a6a891..16e8c6e9c 100644 --- a/app/src/dialog/tooltip.ts +++ b/app/src/dialog/tooltip.ts @@ -30,11 +30,12 @@ export const showTooltip = (message: string, target: Element, error = false) => let top = targetRect.bottom; const position = target.getAttribute("data-position"); const parentRect = target.parentElement.getBoundingClientRect(); - if (position === "right") { + if (position.startsWith("right")) { // block icon left = targetRect.right - messageElement.clientWidth; - } else if (position?.endsWith("bottom")) { - top += parseInt(position); + } + if (position?.endsWith("bottom")) { + top += parseInt(position.replace("right", "")); } else if (position === "parentE") { // file tree and outline态backlink top = parentRect.top; diff --git a/app/src/layout/topBar.ts b/app/src/layout/topBar.ts index c30e2a9fe..0c05fe373 100644 --- a/app/src/layout/topBar.ts +++ b/app/src/layout/topBar.ts @@ -42,7 +42,7 @@ export const initBar = (app: App) => {
-
+