mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 14:34:06 +01:00
🐛 sync tip 转义及支持点击
This commit is contained in:
parent
b2c0f3ea1f
commit
887443c321
4 changed files with 23 additions and 11 deletions
|
|
@ -26,13 +26,16 @@ export const showTooltip = (message: string, target: Element, error = false) =>
|
|||
messageElement.classList.add("tooltip--memo"); // 为行级备注添加 class https://github.com/siyuan-note/siyuan/issues/6161
|
||||
}
|
||||
let left = targetRect.left;
|
||||
let topSpace = 8
|
||||
const position = target.getAttribute("data-position");
|
||||
if (position === "right") {
|
||||
left = targetRect.right - messageElement.clientWidth;
|
||||
} else if (position === "center") {
|
||||
left = targetRect.left + (targetRect.width - messageElement.clientWidth) / 2;
|
||||
} else if (position === "top") {
|
||||
topSpace = 0;
|
||||
}
|
||||
setPosition(messageElement, left, targetRect.top + targetRect.height + 8, targetRect.height * 2 + 8);
|
||||
setPosition(messageElement, left, targetRect.top + targetRect.height + topSpace, targetRect.height * 2 + 8);
|
||||
};
|
||||
|
||||
export const hideTooltip = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue