This commit is contained in:
Vanessa 2023-03-21 09:25:52 +08:00
parent 9cae635647
commit 4bc21c493b
8 changed files with 12 additions and 13 deletions

View file

@ -1,7 +1,6 @@
import {Constants} from "../constants";
/// #if !BROWSER
import {ipcRenderer} from "electron";
import {getCurrentWindow} from "@electron/remote";
/// #endif
import {processMessage} from "./processMessage";
import {kernelError} from "../dialog/processSystem";

View file

@ -42,7 +42,7 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
if (!top && getSelection().rangeCount > 0 && hasClosestBlock(getSelection().getRangeAt(0).startContainer)) {
const editorElement = protyle.contentElement;
const cursorTop = getSelectionPosition(editorElement).top - editorElement.getBoundingClientRect().top;
let top = 0
let top = 0;
if (cursorTop < 0) {
top = editorElement.scrollTop + cursorTop;
} else if (cursorTop > editorElement.clientHeight - 74) { // 74 = 移动端底部 + 段落块高度

View file

@ -150,7 +150,7 @@ export const onGetConfig = (isStart: boolean) => {
try {
JSONToLayout(isStart);
if (window.JSAndroid) {
window.openFileByURL(window.JSAndroid.getBlockURL())
window.openFileByURL(window.JSAndroid.getBlockURL());
}
} catch (e) {
resetLayout();