diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts index 64a1b5518..3646ed340 100644 --- a/app/src/block/popover.ts +++ b/app/src/block/popover.ts @@ -87,11 +87,19 @@ export const initBlockPopover = (app: App) => { hideTooltip(); } } else if (!aElement) { - const tipElement = hasClosestByAttribute(event.target, "id", "tooltip", true); - if (!tipElement || ( - tipElement && (tipElement.clientHeight >= tipElement.scrollHeight && tipElement.clientWidth >= tipElement.scrollWidth) - )) { - hideTooltip(); + const notebookItemElement = hasClosestByClassName(event.target, "b3-list-item__text"); + if (notebookItemElement && notebookItemElement.parentElement.getAttribute("data-type") === "navigation-root") { + fetchPost("/api/notebook/getNotebookInfo", {notebook: notebookItemElement.parentElement.parentElement.getAttribute("data-url")}, (response) => { + const boxData = response.data.boxInfo; + showTooltip(`${boxData.name} ${boxData.hSize}${boxData.docCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", boxData.docCount) : ""}
${window.siyuan.languages.modifiedAt} ${boxData.hMtime}
${window.siyuan.languages.createdAt} ${boxData.hCtime}`,notebookItemElement) + }) + } else { + const tipElement = hasClosestByAttribute(event.target, "id", "tooltip", true); + if (!tipElement || ( + tipElement && (tipElement.clientHeight >= tipElement.scrollHeight && tipElement.clientWidth >= tipElement.scrollWidth) + )) { + hideTooltip(); + } } } if (window.siyuan.config.editor.floatWindowMode === 1 || window.siyuan.shiftIsPressed) {