mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-20 22:14:06 +01:00
This commit is contained in:
parent
9cae635647
commit
4bc21c493b
8 changed files with 12 additions and 13 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 = 移动端底部 + 段落块高度
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue