mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-27 17:34:06 +01:00
This commit is contained in:
parent
2a67a917b8
commit
7ba98f2ee0
4 changed files with 27 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import {setPosition} from "../util/setPosition";
|
||||
import {isMobile} from "../util/functions";
|
||||
|
||||
export const showTooltip = (message: string, target: Element) => {
|
||||
export const showTooltip = (message: string, target: Element, error = false) => {
|
||||
if (isMobile()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -17,7 +17,12 @@ export const showTooltip = (message: string, target: Element) => {
|
|||
} else {
|
||||
messageElement.innerHTML = message;
|
||||
}
|
||||
if(target.getAttribute("data-inline-memo-content")) {
|
||||
if (error) {
|
||||
messageElement.classList.add("tooltip--error");
|
||||
} else {
|
||||
messageElement.classList.remove("tooltip--error");
|
||||
}
|
||||
if (target.getAttribute("data-inline-memo-content")) {
|
||||
messageElement.classList.add("tooltip--memo"); // 为行级备注添加 class https://github.com/siyuan-note/siyuan/issues/6161
|
||||
}
|
||||
let left = targetRect.left;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue