mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 11:28:49 +01:00
This commit is contained in:
parent
046f1b2668
commit
a93baaf00a
1 changed files with 13 additions and 0 deletions
|
|
@ -455,6 +455,19 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
|||
return;
|
||||
}
|
||||
if (operation.action === "update") {
|
||||
// 缩放后仅更新局部 https://github.com/siyuan-note/siyuan/issues/14326
|
||||
if (updateElements.length === 0) {
|
||||
const newUpdateElement = protyle.wysiwyg.element.firstElementChild
|
||||
const newUpdateId = newUpdateElement.getAttribute("data-node-id")
|
||||
const tempElement = document.createElement("template");
|
||||
tempElement.innerHTML = operation.data;
|
||||
const newTempElement = tempElement.content.querySelector(`[data-node-id="${newUpdateId}"]`);
|
||||
if (newTempElement) {
|
||||
updateElements.push(newUpdateElement)
|
||||
operation.data = newTempElement.outerHTML
|
||||
operation.id = newUpdateId
|
||||
}
|
||||
}
|
||||
if (updateElements.length > 0) {
|
||||
updateBlock(updateElements, protyle, operation, isUndo);
|
||||
} else if (isUndo) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue