diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index 40d2f7aea..1e5eab079 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -481,7 +481,7 @@ export class Wnd { this.switchTab(item, true); window.siyuan.menus.menu.remove(); } - event.preventDefault() + event.preventDefault(); event.stopPropagation(); }); }, diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index 4028f01c2..b0ce21368 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -91,8 +91,8 @@ export class Title { event.preventDefault(); event.stopPropagation(); } else if (event.key === "Enter") { - const newId = Lute.NewNodeID() - const newElement = genEmptyElement(false, true, newId) + const newId = Lute.NewNodeID(); + const newElement = genEmptyElement(false, true, newId); protyle.wysiwyg.element.insertAdjacentElement("afterbegin", newElement); focusByWbr(newElement, protyle.toolbar.range || getEditorRange(newElement)); transaction(protyle, [{ diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.ts index 1428343c3..218895e35 100644 --- a/app/src/protyle/toolbar/Font.ts +++ b/app/src/protyle/toolbar/Font.ts @@ -117,7 +117,7 @@ export const fontMenu = (protyle: IProtyle) => { }); element.querySelector("select").addEventListener("change", function (event: Event) { fontEvent(protyle, "fontSize", (event.target as HTMLSelectElement).value); - }) + }); return element; }; diff --git a/app/src/protyle/toolbar/InlineMath.ts b/app/src/protyle/toolbar/InlineMath.ts index c6af3aab1..c54c20f53 100644 --- a/app/src/protyle/toolbar/InlineMath.ts +++ b/app/src/protyle/toolbar/InlineMath.ts @@ -54,7 +54,7 @@ export class InlineMath extends ToolbarItem { } else { range.setStartAfter(newElement); range.collapse(true); - focusByRange(range) + focusByRange(range); nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html); wbrElement.remove(); diff --git a/app/src/protyle/toolbar/InlineMemo.ts b/app/src/protyle/toolbar/InlineMemo.ts index 24186b079..0eda473d8 100644 --- a/app/src/protyle/toolbar/InlineMemo.ts +++ b/app/src/protyle/toolbar/InlineMemo.ts @@ -1,6 +1,4 @@ import {ToolbarItem} from "./ToolbarItem"; -import * as dayjs from "dayjs"; -import {updateTransaction} from "../wysiwyg/transaction"; import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest"; import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock"; import {fixTableRange} from "../util/selection"; diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index fb2af57e1..39aec5b11 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -563,7 +563,7 @@ export class Toolbar { `; this.subElement.querySelector(".b3-button--cancel").addEventListener(getEventName(), () => { refElement.outerHTML = refElement.textContent + ""; - hideElements(["util"], protyle) + hideElements(["util"], protyle); }); const anchorElement = this.subElement.querySelector('[data-type="anchor"]') as HTMLInputElement; anchorElement.value = refElement.textContent; @@ -581,7 +581,7 @@ export class Toolbar { return; } if (event.key === "Enter" || event.key === "Escape") { - hideElements(["util"], protyle) + hideElements(["util"], protyle); event.preventDefault(); event.stopPropagation(); } @@ -594,7 +594,7 @@ export class Toolbar { } else { refElement.innerHTML = "*"; } - this.range.setStartAfter(refElement) + this.range.setStartAfter(refElement); focusByRange(this.range); } else { focusByWbr(nodeElement, this.range); @@ -924,7 +924,7 @@ export class Toolbar { processRender(renderElement); } else { inlineLastNode = renderElement; - renderElement.outerHTML = "" + renderElement.outerHTML = ""; } } else { renderElement.setAttribute("data-content", Lute.EscapeHTMLStr(textElement.value)); @@ -944,7 +944,7 @@ export class Toolbar { this.range.collapse(true); focusByRange(this.range); } else { - focusByWbr(nodeElement, this.range) + focusByWbr(nodeElement, this.range); } } else if (renderElement.parentElement) { this.range.setStartAfter(renderElement); @@ -966,7 +966,7 @@ export class Toolbar { } } updateTransaction(protyle, id, newHTML, html); - } + }; const nodeRect = renderElement.getBoundingClientRect(); this.element.classList.add("fn__none"); if (isPin) { diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts index 0f172faee..878ccbdfd 100644 --- a/app/src/protyle/util/selection.ts +++ b/app/src/protyle/util/selection.ts @@ -522,8 +522,8 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar } } // 需要定位到第一个 child https://github.com/siyuan-note/siyuan/issues/5930 - const range = setFirstNodeRange(cursorElement, getEditorRange(cursorElement)) - focusByRange(range) + const range = setFirstNodeRange(cursorElement, getEditorRange(cursorElement)); + focusByRange(range); return range; } else if (parentElement) { parentElement.focus(); diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index 2c0459230..7bf294bce 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -297,7 +297,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran turnsIntoTransaction({ protyle: protyle, selectsElement: [blockElement], - type: 'Blocks2Ps', + type: "Blocks2Ps", }); return; }