This commit is contained in:
Vanessa 2023-01-06 11:37:48 +08:00
parent 5c60719c4c
commit 25d9b7b43d
2 changed files with 12 additions and 2 deletions

View file

@ -222,6 +222,13 @@ export class Wnd {
}
cloneTabElement.before(oldTab.headElement);
cloneTabElement.remove();
if (oldTab.model instanceof Asset) {
// https://github.com/siyuan-note/siyuan/issues/6890
const pdfViewerElement = oldTab.model.element.querySelector("#viewerContainer");
if (pdfViewerElement) {
pdfViewerElement.setAttribute("data-scrolltop", pdfViewerElement.scrollTop.toString());
}
}
// 对象顺序
const newWnd = getInstanceById(it.parentElement.parentElement.getAttribute("data-id")) as Wnd;
newWnd.moveTab(oldTab, nextTabHeaderElement ? nextTabHeaderElement.getAttribute("data-id") : undefined);