mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
This commit is contained in:
parent
599d6dfa1f
commit
a77e0820ad
1 changed files with 5 additions and 5 deletions
|
|
@ -363,7 +363,7 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
|||
action: "insert",
|
||||
data: previousElement.outerHTML,
|
||||
id: previousElement.getAttribute("data-node-id"),
|
||||
parentID: previousElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID,
|
||||
parentID: getParentBlock(previousElement).getAttribute("data-node-id") || protyle.block.parentID,
|
||||
previousID: (ppElement && (!previousElement.previousElementSibling || !previousElement.previousElementSibling.classList.contains("protyle-action"))) ? ppElement.getAttribute("data-node-id") : undefined
|
||||
}]);
|
||||
previousElement.remove();
|
||||
|
|
@ -414,7 +414,7 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
|||
return;
|
||||
}
|
||||
|
||||
const parentElement = hasClosestBlock(blockElement.parentElement);
|
||||
const parentElement = hasClosestBlock(getParentBlock(blockElement));
|
||||
const editableElement = getContenteditableElement(blockElement);
|
||||
const previousLastElement = getLastBlock(previousElement) as HTMLElement;
|
||||
if (range.toString() === "" && isMobile() && previousLastElement && previousLastElement.classList.contains("hr") && getSelectionOffset(editableElement).start === 0) {
|
||||
|
|
@ -426,7 +426,7 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
|||
data: previousLastElement.outerHTML,
|
||||
id: previousLastElement.getAttribute("data-node-id"),
|
||||
previousID: previousLastElement.previousElementSibling?.getAttribute("data-node-id"),
|
||||
parentID: previousLastElement.parentElement.getAttribute("data-node-id")
|
||||
parentID: getParentBlock(previousLastElement).getAttribute("data-node-id")
|
||||
}]);
|
||||
previousLastElement.remove();
|
||||
return;
|
||||
|
|
@ -452,7 +452,7 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
|||
data: blockElement.outerHTML,
|
||||
id: id,
|
||||
previousID: blockElement.previousElementSibling?.getAttribute("data-node-id"),
|
||||
parentID: blockElement.parentElement.getAttribute("data-node-id")
|
||||
parentID: getParentBlock(blockElement).getAttribute("data-node-id")
|
||||
}];
|
||||
blockElement.remove();
|
||||
// 取消超级块
|
||||
|
|
@ -679,7 +679,7 @@ const removeLi = (protyle: IProtyle, blockElement: Element, range: Range, isDele
|
|||
id: item.getAttribute("data-node-id"),
|
||||
data: item.outerHTML,
|
||||
previousID: index === 0 ? listElement.previousElementSibling?.getAttribute("data-node-id") : doOperations[index - 1].id,
|
||||
parentID: listElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID
|
||||
parentID: getParentBlock(listElement).getAttribute("data-node-id") || protyle.block.parentID
|
||||
});
|
||||
undoOperations.push({
|
||||
action: "delete",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue