mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 21:38:48 +01:00
This commit is contained in:
parent
d64e7b6067
commit
25b577fbee
1 changed files with 21 additions and 9 deletions
|
|
@ -594,9 +594,13 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
|||
if ((event.key === "Enter" || event.key === "Escape") && !event.isComposing) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
protyle.toolbar.range.selectNodeContents(linkElement);
|
||||
protyle.toolbar.range.collapse(false);
|
||||
focusByRange(protyle.toolbar.range);
|
||||
if (linkElement.textContent === "" || linkElement.textContent === Constants.ZWSP) {
|
||||
protyle.toolbar.setInlineMark(protyle, "link", "remove");
|
||||
} else {
|
||||
protyle.toolbar.range.selectNodeContents(linkElement);
|
||||
protyle.toolbar.range.collapse(false);
|
||||
focusByRange(protyle.toolbar.range);
|
||||
}
|
||||
window.siyuan.menus.menu.remove();
|
||||
}
|
||||
});
|
||||
|
|
@ -627,9 +631,13 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
|||
if ((event.key === "Enter" || event.key === "Escape") && !event.isComposing) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
protyle.toolbar.range.selectNodeContents(linkElement);
|
||||
protyle.toolbar.range.collapse(false);
|
||||
focusByRange(protyle.toolbar.range);
|
||||
if (!inputElement.value) {
|
||||
protyle.toolbar.setInlineMark(protyle, "link", "remove");
|
||||
} else {
|
||||
protyle.toolbar.range.selectNodeContents(linkElement);
|
||||
protyle.toolbar.range.collapse(false);
|
||||
focusByRange(protyle.toolbar.range);
|
||||
}
|
||||
window.siyuan.menus.menu.remove();
|
||||
}
|
||||
});
|
||||
|
|
@ -653,9 +661,13 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
|||
if ((event.key === "Enter" || event.key === "Escape") && !event.isComposing) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
protyle.toolbar.range.selectNodeContents(linkElement);
|
||||
protyle.toolbar.range.collapse(false);
|
||||
focusByRange(protyle.toolbar.range);
|
||||
if (linkElement.textContent === "" || linkElement.textContent === Constants.ZWSP) {
|
||||
protyle.toolbar.setInlineMark(protyle, "link", "remove");
|
||||
} else {
|
||||
protyle.toolbar.range.selectNodeContents(linkElement);
|
||||
protyle.toolbar.range.collapse(false);
|
||||
focusByRange(protyle.toolbar.range);
|
||||
}
|
||||
window.siyuan.menus.menu.remove();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue