mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
This commit is contained in:
parent
fd95ae295c
commit
816caa1cf8
1 changed files with 24 additions and 22 deletions
|
|
@ -1125,34 +1125,36 @@ export class WYSIWYG {
|
|||
return false;
|
||||
}
|
||||
protyle.toolbar.range = getEditorRange(protyle.element);
|
||||
const types = protyle.toolbar.getCurrentType(protyle.toolbar.range);
|
||||
if (types.includes("block-ref")) {
|
||||
refMenu(protyle, target);
|
||||
// 阻止 popover
|
||||
target.setAttribute("prevent-popover", "true");
|
||||
setTimeout(() => {
|
||||
target.removeAttribute("prevent-popover");
|
||||
}, 620);
|
||||
return false;
|
||||
}
|
||||
if (types.includes("file-annotation-ref")) {
|
||||
protyle.toolbar.showFileAnnotationRef(protyle, target);
|
||||
return false;
|
||||
}
|
||||
if (types.includes("inline-memo")) {
|
||||
protyle.toolbar.showRender(protyle, target);
|
||||
return false;
|
||||
}
|
||||
if (types.includes("a")) {
|
||||
linkMenu(protyle, target);
|
||||
if (target.getAttribute("data-href")?.startsWith("siyuan://blocks")) {
|
||||
if (target.tagName === "SPAN") { // https://ld246.com/article/1665141518103
|
||||
const types = protyle.toolbar.getCurrentType(protyle.toolbar.range);
|
||||
if (types.includes("block-ref")) {
|
||||
refMenu(protyle, target);
|
||||
// 阻止 popover
|
||||
target.setAttribute("prevent-popover", "true");
|
||||
setTimeout(() => {
|
||||
target.removeAttribute("prevent-popover");
|
||||
}, 620);
|
||||
return false;
|
||||
}
|
||||
if (types.includes("file-annotation-ref")) {
|
||||
protyle.toolbar.showFileAnnotationRef(protyle, target);
|
||||
return false;
|
||||
}
|
||||
if (types.includes("inline-memo")) {
|
||||
protyle.toolbar.showRender(protyle, target);
|
||||
return false;
|
||||
}
|
||||
if (types.includes("a")) {
|
||||
linkMenu(protyle, target);
|
||||
if (target.getAttribute("data-href")?.startsWith("siyuan://blocks")) {
|
||||
// 阻止 popover
|
||||
target.setAttribute("prevent-popover", "true");
|
||||
setTimeout(() => {
|
||||
target.removeAttribute("prevent-popover");
|
||||
}, 620);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (target.tagName === "IMG" && hasClosestByClassName(target, "img")) {
|
||||
imgMenu(protyle, protyle.toolbar.range, target.parentElement.parentElement, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue