mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-20 07:16:10 +01:00
This commit is contained in:
parent
73505073e6
commit
47b66562a6
3 changed files with 9 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue