diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts index 2e8f83843..d545212f8 100644 --- a/app/src/layout/dock/Outline.ts +++ b/app/src/layout/dock/Outline.ts @@ -220,7 +220,7 @@ export class Outline extends Model { public setCurrent(nodeElement: HTMLElement) { if (nodeElement.getAttribute("data-type") === "NodeHeading") { - this.setCurrentById(nodeElement.getAttribute("data-node-id")) + this.setCurrentById(nodeElement.getAttribute("data-node-id")); } else { let previousElement = getPreviousBlock(nodeElement); while (previousElement) { @@ -231,7 +231,7 @@ export class Outline extends Model { } } if (previousElement) { - this.setCurrentById(previousElement.getAttribute("data-node-id")) + this.setCurrentById(previousElement.getAttribute("data-node-id")); } else { fetchPost("/api/block/getBlockBreadcrumb", { id: nodeElement.getAttribute("data-node-id"), diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.ts index b19a2c52d..3518806c5 100644 --- a/app/src/mobile/util/initFramework.ts +++ b/app/src/mobile/util/initFramework.ts @@ -8,7 +8,6 @@ import {fetchPost} from "../../util/fetch"; import {setInlineStyle} from "../../util/assets"; import {renderSnippet} from "../../config/util/snippets"; import {setEmpty} from "./setEmpty"; -import {disabledProtyle, enableProtyle} from "../../protyle/util/onGet"; import {getOpenNotebookCount} from "../../util/pathName"; import {popMenu} from "./menu"; import {MobileFiles} from "./MobileFiles"; @@ -76,7 +75,7 @@ export const initFramework = () => { }); }); window.siyuan.mobile.files = new MobileFiles(); - document.getElementById("toolbarFile").addEventListener("click", (event) => { + document.getElementById("toolbarFile").addEventListener("click", () => { hideKeyboardToolbar(); hideKeyboard(); sidebarElement.style.left = "0"; diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts index dda3e3478..50cb2c13a 100644 --- a/app/src/mobile/util/keyboardToolbar.ts +++ b/app/src/mobile/util/keyboardToolbar.ts @@ -55,7 +55,7 @@ export const renderKeyboardToolbar = (protyle: IProtyle, range: Range) => { -` +`; const html = ` @@ -69,14 +69,14 @@ export const renderKeyboardToolbar = (protyle: IProtyle, range: Range) => { -` +`; toolbarElement.innerHTML = `
${html}
${inlineHTML}
-` -} +`; +}; export const hideKeyboardToolbar = () => { const toolbarElement = document.getElementById("keyboardToolbar"); @@ -93,21 +93,21 @@ const disabledKeyboardToolbar = () => { item.setAttribute("disabled", "disabled"); } }); -} +}; const enKeyboardToolbar = () => { document.querySelectorAll("#keyboardToolbar button").forEach(item => { item.removeAttribute("disabled"); }); -} +}; export const initKeyboardToolbar = () => { - window.addEventListener('focus', (event) => { - const target = event.target as HTMLElement + window.addEventListener("focus", (event) => { + const target = event.target as HTMLElement; if (["INPUT", "TEXTAREA"].includes(target.tagName)) { - disabledKeyboardToolbar() + disabledKeyboardToolbar(); } else if (target.classList.contains("protyle-wysiwyg")) { - enKeyboardToolbar() + enKeyboardToolbar(); } }, true); diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 35711acda..1a6f4b072 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -778,7 +778,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { }); } - const sourceIds: string [] = [] + const sourceIds: string [] = []; sourceElements.forEach(item => { item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl"); item.removeAttribute("select-start"); diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts index 447a2372e..1fb0bb825 100644 --- a/app/src/protyle/util/selection.ts +++ b/app/src/protyle/util/selection.ts @@ -213,7 +213,7 @@ export const getSelectionPosition = (nodeElement: Element, range?: Range) => { return { // 选中多行不应遮挡第一行 https://github.com/siyuan-note/siyuan/issues/7541 left: rects[rects.length - 1].left, top: rects[0].top - } + }; } return { diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 3c8712691..d01cf7386 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -176,7 +176,7 @@ export class WYSIWYG { if (protyle.model) { getAllModels().outline.forEach(item => { if (item.blockId === protyle.block.rootID) { - item.setCurrent(nodeElement) + item.setCurrent(nodeElement); } }); }