From b2c76638beb8cbf4dbd61228c6631f1df2e0d31e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 12 Jul 2023 15:13:37 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8722 --- app/src/dialog/tooltip.ts | 5 +++-- app/src/layout/dock/Files.ts | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/dialog/tooltip.ts b/app/src/dialog/tooltip.ts index 6069b77d2..4d162adc9 100644 --- a/app/src/dialog/tooltip.ts +++ b/app/src/dialog/tooltip.ts @@ -17,8 +17,9 @@ export const showTooltip = (message: string, target: Element, error = false) => } else { messageElement.innerHTML = message; } - if (target.getAttribute("data-type") === "navigation-file") { - setPosition(messageElement, targetRect.right, targetRect.top); + if (target.parentElement.getAttribute("data-type") === "navigation-file") { + const parentRect = target.parentElement.getBoundingClientRect(); + setPosition(messageElement, parentRect.right, parentRect.top); return; } if (error) { diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index fd356ded6..168302244 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -984,15 +984,15 @@ export class Files extends Model { if (item.count && item.count > 0) { countHTML = `${item.count}`; } - return `
  • " + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "
    " + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "
    " + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "
    " + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}
    ${window.siyuan.languages.modifiedAt} ${item.hMtime}
    ${window.siyuan.languages.createdAt} ${item.hCtime}" -data-node-id="${item.id}" data-name="${Lute.EscapeHTMLStr(item.name)}" draggable="true" data-count="${item.subFileCount}" + return `
  • +class="b3-list-item b3-list-item--hide-action" data-path="${item.path}"> ${unicode2Emoji(item.icon || (item.subFileCount === 0 ? Constants.SIYUAN_IMAGE_FILE : Constants.SIYUAN_IMAGE_FOLDER))} - ${getDisplayName(item.name, true, true)} + " + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "
    " + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "
    " + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "
    " + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}
    ${window.siyuan.languages.modifiedAt} ${item.hMtime}
    ${window.siyuan.languages.createdAt} ${item.hCtime}">${getDisplayName(item.name, true, true)}