Vanessa 2023-06-01 14:56:21 +08:00
parent 8c35440a77
commit 74b4a00a2f
42 changed files with 426 additions and 270 deletions

View file

@ -7,8 +7,9 @@ import {hasClosestByAttribute, hasClosestByClassName} from "../util/hasClosest";
import {isMac} from "../util/compatibility";
import {setInlineStyle} from "../../util/assets";
import {fetchPost} from "../../util/fetch";
import {App} from "../../index";
export const initUI = (protyle: IProtyle) => {
export const initUI = (protyle: IProtyle, app: App) => {
protyle.contentElement = document.createElement("div");
protyle.contentElement.className = "protyle-content";
if (window.siyuan.config.editor.fullWidth) {
@ -24,7 +25,7 @@ export const initUI = (protyle: IProtyle) => {
}
protyle.contentElement.appendChild(protyle.wysiwyg.element);
if (!protyle.options.action.includes(Constants.CB_GET_HISTORY)) {
scrollEvent(protyle, protyle.contentElement);
scrollEvent(app, protyle, protyle.contentElement);
}
protyle.element.append(protyle.contentElement);
protyle.element.appendChild(protyle.preview.element);