💄 tip and memo

This commit is contained in:
Vanessa 2024-04-29 23:30:23 +08:00
parent b1dc272e10
commit e2f1a82db4
2 changed files with 5 additions and 4 deletions

View file

@ -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;

View file

@ -42,7 +42,7 @@ export const initBar = (app: App) => {
<div id="barPlugins" class="toolbar__item ariaLabel" aria-label="${window.siyuan.languages.plugin}">
<svg><use xlink:href="#iconPlugin"></use></svg>
</div>
<div id="barCommand" class="toolbar__item ariaLabel" aria-label="${window.siyuan.config.keymap.general.commandPanel.custom}">
<div id="barCommand" class="toolbar__item ariaLabel" aria-label="${window.siyuan.languages.commandPanel} ${updateHotkeyTip(window.siyuan.config.keymap.general.commandPanel.custom)}">
<svg><use xlink:href="#iconLayoutBottom"></use></svg>
</div>
<div id="barSearch" class="toolbar__item ariaLabel" aria-label="${window.siyuan.languages.globalSearch} ${updateHotkeyTip(window.siyuan.config.keymap.general.globalSearch.custom)}">