This commit is contained in:
parent
d633aad606
commit
b75be56ac0
3 changed files with 6 additions and 5 deletions
|
@ -267,9 +267,9 @@ let rectElement: HTMLElement;
|
|||
const showToolbar = (element: HTMLElement, range: Range, target?: HTMLElement) => {
|
||||
if (target) {
|
||||
// 阻止 popover
|
||||
target.classList.remove("popover__block");
|
||||
target.setAttribute("prevent-popover", "true");
|
||||
setTimeout(() => {
|
||||
target.classList.add("popover__block");
|
||||
target.removeAttribute("prevent-popover");
|
||||
}, 620);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,8 @@ export const initBlockPopover = () => {
|
|||
if (!popoverTargetElement && aElement && aElement.getAttribute("data-href")?.startsWith("siyuan://blocks") && aElement.getAttribute("prevent-popover") !== "true") {
|
||||
popoverTargetElement = aElement;
|
||||
}
|
||||
if (!popoverTargetElement || window.siyuan.altIsPressed || window.siyuan.shiftIsPressed || window.siyuan.ctrlIsPressed) {
|
||||
if (!popoverTargetElement || window.siyuan.altIsPressed || window.siyuan.shiftIsPressed || window.siyuan.ctrlIsPressed ||
|
||||
(popoverTargetElement && popoverTargetElement.getAttribute("prevent-popover") === "true")) {
|
||||
return;
|
||||
}
|
||||
// https://github.com/siyuan-note/siyuan/issues/4314
|
||||
|
|
|
@ -452,9 +452,9 @@ export class WYSIWYG {
|
|||
const rect = target.getBoundingClientRect();
|
||||
setPosition(window.siyuan.menus.menu.element, rect.left, rect.top + 13, 26);
|
||||
// 阻止 popover
|
||||
target.removeAttribute("data-type");
|
||||
target.setAttribute("prevent-popover", "true");
|
||||
setTimeout(() => {
|
||||
target.setAttribute("data-type", "block-ref");
|
||||
target.removeAttribute("prevent-popover");
|
||||
}, 620);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue