diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 4d2922336..5db14daf1 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -2302,7 +2302,7 @@ export class Gutter { data: e.outerHTML }); if (e.getAttribute("data-subtype") === "echarts") { - const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_")); + const chartInstance = window.echarts.getInstanceById(e.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_")); if (chartInstance) { chartInstance.resize(); } @@ -2346,7 +2346,7 @@ export class Gutter { e.style.width = item; e.style.flex = "none"; if (e.getAttribute("data-subtype") === "echarts") { - const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_")); + const chartInstance = window.echarts.getInstanceById(e.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_")); if (chartInstance) { chartInstance.resize(); } @@ -2392,7 +2392,7 @@ export class Gutter { e.style.width = ""; e.style.flex = ""; if (e.getAttribute("data-subtype") === "echarts") { - const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_")); + const chartInstance = window.echarts.getInstanceById(e.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_")); if (chartInstance) { chartInstance.resize(); } diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 6cbe24116..bb92ae7a7 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -1,6 +1,6 @@ import {setEditMode} from "../util/setEditMode"; import {scrollEvent} from "../scroll/event"; -import {isMobile, isTouchDevice} from "../../util/functions"; +import {isMobile} from "../../util/functions"; import {Constants} from "../../constants"; import {isMac} from "../util/compatibility"; import {setInlineStyle} from "../../util/assets"; diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts index e2b1c0bb9..5f2f4fe92 100644 --- a/app/src/protyle/util/resize.ts +++ b/app/src/protyle/util/resize.ts @@ -67,7 +67,7 @@ export const resize = (protyle: IProtyle) => { if (abs.width > MIN_ABS || isNaN(abs.width)) { if (typeof window.echarts !== "undefined") { protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => { - const chartInstance = window.echarts.getInstanceById(chartItem.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_")); + const chartInstance = window.echarts.getInstanceById(chartItem.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_")); if (chartInstance) { chartInstance.resize(); } diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts index 9dd58bf47..4e106b9fa 100644 --- a/app/src/protyle/util/table.ts +++ b/app/src/protyle/util/table.ts @@ -100,25 +100,25 @@ export const insertRow = (protyle: IProtyle, range: Range, cellElement: HTMLElem for (let m = 0; m < cellElement.parentElement.childElementCount; m++) { rowHTML += ``; } - let newRowElememt: HTMLTableRowElement; + let newRowElement: HTMLTableRowElement; if (cellElement.tagName === "TH") { const tbodyElement = nodeElement.querySelector("tbody"); if (tbodyElement) { tbodyElement.insertAdjacentHTML("afterbegin", `${rowHTML}`); - newRowElememt = tbodyElement.firstElementChild as HTMLTableRowElement; + newRowElement = tbodyElement.firstElementChild as HTMLTableRowElement; } else { cellElement.parentElement.parentElement.insertAdjacentHTML("afterend", `${rowHTML}`); - newRowElememt = cellElement.parentElement.parentElement.nextElementSibling.firstElementChild as HTMLTableRowElement; + newRowElement = cellElement.parentElement.parentElement.nextElementSibling.firstElementChild as HTMLTableRowElement; } } else { cellElement.parentElement.insertAdjacentHTML("afterend", `${rowHTML}`); - newRowElememt = cellElement.parentElement.nextElementSibling as HTMLTableRowElement; + newRowElement = cellElement.parentElement.nextElementSibling as HTMLTableRowElement; } - range.selectNodeContents(newRowElememt.cells[getColIndex(cellElement)]); + range.selectNodeContents(newRowElement.cells[getColIndex(cellElement)]); range.collapse(true); focusByRange(range); updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html); - scrollToView(nodeElement, newRowElememt, protyle); + scrollToView(nodeElement, newRowElement, protyle); }; export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTMLElement, nodeElement: Element, count = 1) => { @@ -156,10 +156,10 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTM previousTrElement = previousTrElement.previousElementSibling; } } - let newRowElememt: HTMLTableRowElement; + let newRowElement: HTMLTableRowElement; if (cellElement.parentElement.parentElement.tagName === "THEAD" && !cellElement.parentElement.previousElementSibling) { cellElement.parentElement.parentElement.insertAdjacentHTML("beforebegin", `${rowHTML}`); - newRowElememt = nodeElement.querySelector("thead tr"); + newRowElement = nodeElement.querySelector("thead tr"); if (count > 1) { cellElement.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin", `${rowHTML.replace(//g, "")}`.repeat(count - 1)); } @@ -167,13 +167,13 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTM cellElement.parentElement.parentElement.remove(); } else { cellElement.parentElement.insertAdjacentHTML("beforebegin", `${rowHTML}`.repeat(count)); - newRowElememt = cellElement.parentElement.previousElementSibling as HTMLTableRowElement; + newRowElement = cellElement.parentElement.previousElementSibling as HTMLTableRowElement; } - range.selectNodeContents(newRowElememt.cells[getColIndex(cellElement)]); + range.selectNodeContents(newRowElement.cells[getColIndex(cellElement)]); range.collapse(true); focusByRange(range); updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html); - scrollToView(nodeElement, newRowElememt, protyle); + scrollToView(nodeElement, newRowElement, protyle); }; export const insertColumn = (protyle: IProtyle, nodeElement: Element, cellElement: HTMLElement, type: InsertPosition, range: Range) => {