mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 07:19:38 +08:00
This commit is contained in:
parent
2fa11137a0
commit
5cd040b302
@ -482,18 +482,20 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
|||||||
// 缩放后仅更新局部 https://github.com/siyuan-note/siyuan/issues/14326
|
// 缩放后仅更新局部 https://github.com/siyuan-note/siyuan/issues/14326
|
||||||
if (updateElements.length === 0) {
|
if (updateElements.length === 0) {
|
||||||
const newUpdateElement = protyle.wysiwyg.element.querySelector("[data-node-id]");
|
const newUpdateElement = protyle.wysiwyg.element.querySelector("[data-node-id]");
|
||||||
const newUpdateId = newUpdateElement.getAttribute("data-node-id");
|
if (newUpdateElement) {
|
||||||
const tempElement = document.createElement("template");
|
const newUpdateId = newUpdateElement.getAttribute("data-node-id");
|
||||||
tempElement.innerHTML = operation.data;
|
const tempElement = document.createElement("template");
|
||||||
const newTempElement = tempElement.content.querySelector(`[data-node-id="${newUpdateId}"]`);
|
tempElement.innerHTML = operation.data;
|
||||||
if (newTempElement) {
|
const newTempElement = tempElement.content.querySelector(`[data-node-id="${newUpdateId}"]`);
|
||||||
updateElements.push(newUpdateElement);
|
if (newTempElement) {
|
||||||
operation.data = newTempElement.outerHTML;
|
updateElements.push(newUpdateElement);
|
||||||
operation.id = newUpdateId;
|
operation.data = newTempElement.outerHTML;
|
||||||
// https://github.com/siyuan-note/siyuan/issues/14326#issuecomment-2746140335
|
operation.id = newUpdateId;
|
||||||
for (let i = 1; i < protyle.wysiwyg.element.childElementCount; i++) {
|
// https://github.com/siyuan-note/siyuan/issues/14326#issuecomment-2746140335
|
||||||
protyle.wysiwyg.element.childNodes[i].remove();
|
for (let i = 1; i < protyle.wysiwyg.element.childElementCount; i++) {
|
||||||
i--;
|
protyle.wysiwyg.element.childNodes[i].remove();
|
||||||
|
i--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user