mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-06 23:51:48 +01:00
This commit is contained in:
parent
b126d34dde
commit
61bc821754
2 changed files with 17 additions and 7 deletions
|
|
@ -16,7 +16,7 @@ import {
|
|||
import {newFile} from "../../util/newFile";
|
||||
import {Constants} from "../../constants";
|
||||
import {openSetting} from "../../config";
|
||||
import {getInstanceById} from "../../layout/util";
|
||||
import {getInstanceById, saveLayout} from "../../layout/util";
|
||||
import {getActiveTab, getDockByType, switchTabByIndex} from "../../layout/tabUtil";
|
||||
import {Tab} from "../../layout/Tab";
|
||||
import {Editor} from "../../editor";
|
||||
|
|
@ -490,6 +490,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.preview.custom, event)) {
|
||||
setEditMode(protyle, "preview");
|
||||
saveLayout();
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -497,11 +498,16 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
setEditMode(protyle, "wysiwyg");
|
||||
protyle.scroll.lastScrollTop = 0;
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
id: protyle.block.parentID,
|
||||
size: window.siyuan.config.editor.dynamicLoadBlocks,
|
||||
id: protyle.block.id,
|
||||
size: protyle.block.id === protyle.block.rootID ? window.siyuan.config.editor.dynamicLoadBlocks : Constants.SIZE_GET_MAX,
|
||||
}, getResponse => {
|
||||
onGet({data: getResponse, protyle});
|
||||
onGet({
|
||||
data: getResponse,
|
||||
protyle,
|
||||
action: protyle.block.id === protyle.block.rootID ? [Constants.CB_GET_FOCUS, Constants.CB_GET_HTML, Constants.CB_GET_UNUNDO] : [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS, Constants.CB_GET_UNUNDO, Constants.CB_GET_HTML]
|
||||
});
|
||||
});
|
||||
saveLayout();
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -444,10 +444,14 @@ ${padHTML}
|
|||
setEditMode(protyle, "wysiwyg");
|
||||
protyle.scroll.lastScrollTop = 0;
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
id: protyle.block.parentID,
|
||||
size: window.siyuan.config.editor.dynamicLoadBlocks,
|
||||
id: protyle.block.id,
|
||||
size: protyle.block.id === protyle.block.rootID ? window.siyuan.config.editor.dynamicLoadBlocks : Constants.SIZE_GET_MAX,
|
||||
}, getResponse => {
|
||||
onGet({data: getResponse, protyle});
|
||||
onGet({
|
||||
data: getResponse,
|
||||
protyle,
|
||||
action: protyle.block.id === protyle.block.rootID ? [Constants.CB_GET_FOCUS, Constants.CB_GET_HTML, Constants.CB_GET_UNUNDO] : [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS, Constants.CB_GET_UNUNDO, Constants.CB_GET_HTML]
|
||||
});
|
||||
});
|
||||
/// #if !MOBILE
|
||||
saveLayout();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue