diff --git a/app/src/config/util/snippets.ts b/app/src/config/util/snippets.ts index 4caea26ca..248dcb6c8 100644 --- a/app/src/config/util/snippets.ts +++ b/app/src/config/util/snippets.ts @@ -1,5 +1,4 @@ import {fetchPost} from "../../util/fetch"; -import {hasClosestByClassName} from "../../protyle/util/hasClosest"; import {Dialog} from "../../dialog"; import {objEquals} from "../../util/functions"; import {confirmDialog} from "../../dialog/confirmDialog"; diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 66b4955d4..61dfe9edc 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -583,7 +583,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => { y: rect.top + 26, h: 26 }); - window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app") + window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app"); if (!protyle.disabled) { window.siyuan.menus.menu.element.querySelector("input").select(); window.siyuan.menus.menu.removeCB = () => { @@ -1063,7 +1063,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme } window.siyuan.menus.menu.popup({x: position.clientX, y: position.clientY}); - window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app") + window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app"); if (!protyle.disabled) { const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea"); textElements[0].focus(); @@ -1250,7 +1250,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText y: rect.top + 26, h: 26 }); - window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app") + window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app"); const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea"); if (focusText || protyle.lute.IsValidLinkDest(linkAddress)) { textElements[1].select(); @@ -1387,7 +1387,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => { y: rect.top + 26, h: 26 }); - window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app") + window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app"); window.siyuan.menus.menu.element.querySelector("input").select(); }; diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 43ad05d23..6719a1ab8 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -247,7 +247,7 @@ export class Gutter { window.siyuan.menus.menu.fullscreen(); } else { window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true}); - window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app") + window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app"); focusByRange(protyle.toolbar.range); } } @@ -260,7 +260,7 @@ export class Gutter { if (!window.siyuan.ctrlIsPressed && !window.siyuan.altIsPressed && !window.siyuan.shiftIsPressed) { this.renderMenu(protyle, buttonElement); window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true}); - window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app") + window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app"); } event.preventDefault(); event.stopPropagation(); diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 1b3b8da27..75c946c99 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -589,7 +589,7 @@ export const renderCell = (cellValue: IAVCellValue, wrap: boolean) => { text += ``; } return text; -} +}; export const updateHeaderCell = (cellElement: HTMLElement, headerValue: { icon?: string, @@ -598,16 +598,16 @@ export const updateHeaderCell = (cellElement: HTMLElement, headerValue: { }) => { if (typeof headerValue.icon !== "undefined") { cellElement.dataset.icon = headerValue.icon; - cellElement.querySelector(".av__cellheadericon").outerHTML = headerValue.icon ? unicode2Emoji(headerValue.icon, "av__cellheadericon", true) : `` + cellElement.querySelector(".av__cellheadericon").outerHTML = headerValue.icon ? unicode2Emoji(headerValue.icon, "av__cellheadericon", true) : ``; } if (typeof headerValue.name !== "undefined") { cellElement.querySelector(".av__celltext").textContent = headerValue.name; } if (typeof headerValue.pin !== "undefined") { - const textElement = cellElement.querySelector(".av__celltext") + const textElement = cellElement.querySelector(".av__celltext"); if (headerValue.pin) { if (!textElement.nextElementSibling) { - textElement.insertAdjacentHTML("afterend", '
') + textElement.insertAdjacentHTML("afterend", '
'); } } else { if (textElement.nextElementSibling) { @@ -616,4 +616,4 @@ export const updateHeaderCell = (cellElement: HTMLElement, headerValue: { } } } -} +}; diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts index 0de4f8b27..76576162a 100644 --- a/app/src/protyle/wysiwyg/enter.ts +++ b/app/src/protyle/wysiwyg/enter.ts @@ -389,12 +389,12 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle action: "update", data: blockElement.outerHTML, id: id, - }] + }]; const undoOperation: IOperation[] = [{ action: "update", data: html, id: id, - }] + }]; let previousElement = blockElement; Array.from(newElement.children).forEach((item: HTMLElement) => { const newId = item.getAttribute("data-node-id"); @@ -403,15 +403,15 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle data: item.outerHTML, id: newId, previousID: previousElement.getAttribute("data-node-id"), - }) + }); undoOperation.push({ action: "delete", id: newId, - }) + }); previousElement.insertAdjacentElement("afterend", item); mathRender(previousElement.nextElementSibling); previousElement = item; - }) + }); transaction(protyle, doOperation, undoOperation); focusBlock(blockElement.nextElementSibling); scrollCenter(protyle);