mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
This commit is contained in:
parent
b0453dfaba
commit
18eca7f8d3
1 changed files with 4 additions and 3 deletions
|
|
@ -241,7 +241,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
|||
if (sideElement) {
|
||||
if (protyle.block.showAll && sideElement.classList.contains("protyle-wysiwyg") && protyle.wysiwyg.element.childElementCount === 0) {
|
||||
setTimeout(() => {
|
||||
zoomOut({protyle, id:protyle.block.parent2ID, focusId:protyle.block.parent2ID});
|
||||
zoomOut({protyle, id: protyle.block.parent2ID, focusId: protyle.block.parent2ID});
|
||||
}, Constants.TIMEOUT_INPUT * 2 + 100);
|
||||
} else {
|
||||
if ((sideElement.classList.contains("protyle-wysiwyg") && protyle.wysiwyg.element.childElementCount === 0)) {
|
||||
|
|
@ -385,7 +385,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
|||
|
||||
const parentElement = blockElement.parentElement;
|
||||
const editableElement = getContenteditableElement(blockElement);
|
||||
const previousLastElement = getLastBlock(previousElement) as HTMLElement;
|
||||
let previousLastElement = getLastBlock(previousElement) as HTMLElement;
|
||||
const isSelectNode = previousLastElement && (previousLastElement.classList.contains("table") || previousLastElement.classList.contains("render-node") || previousLastElement.classList.contains("iframe") || previousLastElement.classList.contains("hr") || previousLastElement.classList.contains("code-block"));
|
||||
const previousId = previousLastElement.getAttribute("data-node-id");
|
||||
if (isSelectNode) {
|
||||
|
|
@ -412,7 +412,8 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
|||
transaction(protyle, doOperations, undoOperations);
|
||||
}
|
||||
// toStart 参数不能为 false, 否则 https://github.com/siyuan-note/siyuan/issues/9141
|
||||
focusBlock(protyle.wysiwyg.element.querySelector(`[data-node-id="${previousId}"]`), undefined, true);
|
||||
previousLastElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${previousId}"]`)
|
||||
focusBlock(previousLastElement, undefined, getContenteditableElement(previousLastElement).textContent === "\n");
|
||||
} else {
|
||||
focusBlock(previousLastElement, undefined, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue