mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
afb5327c43
commit
f7ae1d04ec
3 changed files with 15 additions and 8 deletions
|
|
@ -6,6 +6,7 @@ import {hasClosestByAttribute, hasClosestByClassName} from "../util/hasClosest";
|
|||
import {isMac} from "../util/compatibility";
|
||||
import {setInlineStyle} from "../../util/assets";
|
||||
import {fetchPost} from "../../util/fetch";
|
||||
import {lineNumberRender} from "../render/highlightRender";
|
||||
|
||||
export const initUI = (protyle: IProtyle) => {
|
||||
protyle.contentElement = document.createElement("div");
|
||||
|
|
@ -92,6 +93,11 @@ export const initUI = (protyle: IProtyle) => {
|
|||
clearTimeout(wheelTimeout);
|
||||
wheelTimeout = window.setTimeout(() => {
|
||||
fetchPost("/api/setting/setEditor", window.siyuan.config.editor);
|
||||
if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) {
|
||||
protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber").forEach((block: HTMLElement) => {
|
||||
lineNumberRender(block);
|
||||
});
|
||||
}
|
||||
}, Constants.TIMEOUT_LOAD);
|
||||
}, {passive: false});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue