mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
a82fa8be36
commit
c58299a957
2 changed files with 15 additions and 2 deletions
|
|
@ -149,6 +149,9 @@ const moveToNew = (protyle: IProtyle, sourceElements: Element[], targetElement:
|
||||||
id: newSourceId,
|
id: newSourceId,
|
||||||
});
|
});
|
||||||
if (foldData) {
|
if (foldData) {
|
||||||
|
foldData.doOperations[0].context = {
|
||||||
|
focusId: sourceElements[0].getAttribute("data-node-id"),
|
||||||
|
};
|
||||||
doOperations.push(...foldData.doOperations);
|
doOperations.push(...foldData.doOperations);
|
||||||
undoOperations.push(...foldData.undoOperations);
|
undoOperations.push(...foldData.undoOperations);
|
||||||
}
|
}
|
||||||
|
|
@ -258,6 +261,9 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen
|
||||||
undoOperations.push(...responseTransaction.data.undoOperations);
|
undoOperations.push(...responseTransaction.data.undoOperations);
|
||||||
}
|
}
|
||||||
if (foldData) {
|
if (foldData) {
|
||||||
|
foldData.doOperations[0].context = {
|
||||||
|
focusId: sourceElements[0].getAttribute("data-node-id"),
|
||||||
|
};
|
||||||
doOperations.push(...foldData.doOperations);
|
doOperations.push(...foldData.doOperations);
|
||||||
undoOperations.push(...foldData.undoOperations);
|
undoOperations.push(...foldData.undoOperations);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import {countBlockWord} from "../../layout/status";
|
||||||
import {isPaidUser, needSubscribe} from "../../util/needSubscribe";
|
import {isPaidUser, needSubscribe} from "../../util/needSubscribe";
|
||||||
import {resize} from "../util/resize";
|
import {resize} from "../util/resize";
|
||||||
import {processClonePHElement} from "../render/util";
|
import {processClonePHElement} from "../render/util";
|
||||||
|
import {scrollCenter} from "../../util/highlightById";
|
||||||
|
|
||||||
const removeTopElement = (updateElement: Element, protyle: IProtyle) => {
|
const removeTopElement = (updateElement: Element, protyle: IProtyle) => {
|
||||||
// 移动到其他文档中,该块需移除
|
// 移动到其他文档中,该块需移除
|
||||||
|
|
@ -1395,8 +1396,14 @@ const processFold = (operation: IOperation, protyle: IProtyle) => {
|
||||||
highlightRender(protyle.wysiwyg.element);
|
highlightRender(protyle.wysiwyg.element);
|
||||||
avRender(protyle.wysiwyg.element, protyle);
|
avRender(protyle.wysiwyg.element, protyle);
|
||||||
blockRender(protyle, protyle.wysiwyg.element);
|
blockRender(protyle, protyle.wysiwyg.element);
|
||||||
|
if (operation.context.focusId) {
|
||||||
|
const focusElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${operation.context.focusId}"]`);
|
||||||
|
focusBlock(focusElement);
|
||||||
|
scrollCenter(protyle, focusElement, false);
|
||||||
|
} else {
|
||||||
protyle.contentElement.scrollTop = scrollTop;
|
protyle.contentElement.scrollTop = scrollTop;
|
||||||
protyle.scroll.lastScrollTop = scrollTop;
|
protyle.scroll.lastScrollTop = scrollTop;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
|
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue