Vanessa 2025-04-04 18:33:24 +08:00
parent 4d0c136a56
commit 7a632bb718
2 changed files with 18 additions and 0 deletions

View file

@ -267,6 +267,19 @@ export const copyTab = (app: App, tab: Tab) => {
rootId: tab.model.editor.protyle.block.rootID,
// https://github.com/siyuan-note/siyuan/issues/12150
action: newAction,
afterInitProtyle(editor) {
// https://github.com/siyuan-note/siyuan/issues/13851
if (tab.model instanceof Editor) {
const copyResizeTopElement = tab.model.editor.protyle.wysiwyg.element.querySelector("[data-resize-top]")
if (copyResizeTopElement) {
const newElement = editor.protyle.wysiwyg.element.querySelector(`[data-node-id="${copyResizeTopElement.getAttribute("data-node-id")}"]`)
if (newElement) {
newElement.scrollIntoView();
editor.protyle.contentElement.scrollTop += newElement.getBoundingClientRect().top - parseInt(copyResizeTopElement.getAttribute("data-resize-top"));
}
}
}
}
});
} else if (tab.model instanceof Asset) {
model = new Asset({