mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-07 01:08:49 +01:00
This commit is contained in:
parent
90432f818a
commit
e1d8a609d0
2 changed files with 9 additions and 4 deletions
|
|
@ -1471,8 +1471,13 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
}
|
||||
|
||||
if (matchHotKey("⌘C", event) && selectText === "") {
|
||||
const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
|
||||
if (selectElements.length === 0) {
|
||||
nodeElement.classList.add("protyle-wysiwyg--select");
|
||||
selectElements.push(nodeElement);
|
||||
}
|
||||
let html = "";
|
||||
protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select").forEach(item => {
|
||||
selectElements.forEach(item => {
|
||||
html += removeEmbed(item);
|
||||
});
|
||||
if (html !== "") {
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
|||
action: "delete",
|
||||
id,
|
||||
});
|
||||
sideElement = getPreviousBlock(topElement) || getNextBlock(topElement) || topElement.parentElement || protyle.wysiwyg.element.firstElementChild;
|
||||
sideElement = getNextBlock(topElement) || getPreviousBlock(topElement) || topElement.parentElement || protyle.wysiwyg.element.firstElementChild;
|
||||
if (topElement.getAttribute("data-type") === "NodeHeading" && topElement.getAttribute("fold") === "1") {
|
||||
// https://github.com/siyuan-note/siyuan/issues/2188
|
||||
setFold(protyle, topElement, undefined, true);
|
||||
|
|
@ -268,8 +268,8 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
|||
sideElement = undefined;
|
||||
focusByWbr(emptyElement, range);
|
||||
}
|
||||
|
||||
focusBlock(sideElement, undefined, false);
|
||||
// https://github.com/siyuan-note/siyuan/issues/5485
|
||||
focusBlock(sideElement);
|
||||
scrollCenter(protyle, sideElement);
|
||||
if (listElement) {
|
||||
inserts.push({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue