Vanessa 2023-12-09 17:52:10 +08:00
parent 73505073e6
commit 47b66562a6
3 changed files with 9 additions and 3 deletions

View file

@ -473,7 +473,7 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
json.blockId = layout.editor.protyle.block.id;
json.rootId = layout.editor.protyle.block.rootID;
json.mode = layout.editor.protyle.preview.element.classList.contains("fn__none") ? "wysiwyg" : "preview";
json.action = layout.editor.protyle.block.showAll ? Constants.CB_GET_ALL : "";
json.action = layout.editor.protyle.block.showAll ? Constants.CB_GET_ALL : Constants.CB_GET_SCROLL;
json.instance = "Editor";
saveScroll(layout.editor.protyle);
} else if (layout instanceof Asset) {

View file

@ -228,10 +228,15 @@ export class Protyle {
removeLoading(this.protyle);
return;
}
if (options.rootId) {
const filePosition = window.siyuan.storage[Constants.LOCAL_FILEPOSITION][options.blockId] ||
window.siyuan.storage[Constants.LOCAL_FILEPOSITION][options.rootId];
if (this.protyle.options.mode !== "preview" &&
!mergedOptions.action.includes(Constants.CB_GET_ALL) &&
(mergedOptions.action.includes(Constants.CB_GET_SCROLL) || mergedOptions.action.includes(Constants.CB_GET_ROOTSCROLL)) &&
filePosition) {
getDocByScroll({
protyle: this.protyle,
scrollAttr: window.siyuan.storage[Constants.LOCAL_FILEPOSITION][options.rootId],
scrollAttr: filePosition,
mergedOptions,
cb: () => {
this.afterOnGet(mergedOptions);

View file

@ -53,6 +53,7 @@ export const openNewWindowById = (id: string, options: windowOptions = {}) => {
}
};
if (response.data.rootID === id) {
json.children.action = Constants.CB_GET_SCROLL;
/// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_OPEN_WINDOW, {
position: options.position,