From 62cf6411a0a0d2bb3506f524cecf77fe7a9f590c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 16 Jan 2023 00:00:53 +0800 Subject: [PATCH] :rotating_light: --- app/src/block/popover.ts | 4 ++-- app/src/dialog/processSystem.ts | 12 ++++++------ app/src/layout/dock/util.ts | 2 +- app/src/layout/status.ts | 1 - app/src/layout/util.ts | 4 ++-- app/src/menus/protyle.ts | 2 +- app/src/menus/workspace.ts | 4 ++-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts index 64c4b21f3..6477d4e19 100644 --- a/app/src/block/popover.ts +++ b/app/src/block/popover.ts @@ -99,9 +99,9 @@ const hidePopover = (event: MouseEvent & { target: HTMLElement, path: HTMLElemen if (!popoverTargetElement) { // 移动到弹窗的 loading 元素上,但经过 settimeout 后 loading 已经被移除了 // https://ld246.com/article/1673596577519/comment/1673767749885#comments - let targetElement = event.target + let targetElement = event.target; if (!targetElement.parentElement) { - targetElement = event.path[1] + targetElement = event.path[1]; } const blockElement = hasClosestByClassName(targetElement, "block__popover", true); const maxEditLevels: { [key: string]: number } = {oid: 0}; diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index f72fa9fc9..6e2775a5d 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -282,10 +282,10 @@ export const setTitle = (title: string, protyle?: IProtyle) => { } else { title = title || "Untitled"; if (protyle && protyle.disabled) { - title = `[${window.siyuan.languages.editReadonly}] ${title}` + title = `[${window.siyuan.languages.editReadonly}] ${title}`; } if (protyle && protyle.block.showAll) { - title = `[${window.siyuan.languages.enter}] ${title}` + title = `[${window.siyuan.languages.enter}] ${title}`; } document.title = `${title} - ${workspaceName} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`; dragElement.textContent = title; @@ -298,10 +298,10 @@ export const updateTitle = (readonly?: boolean, zoomIn?: boolean) => { if (typeof readonly === "boolean") { if (readonly) { if (title.indexOf(window.siyuan.languages.editReadonly) === -1) { - setTitle(`[${window.siyuan.languages.editReadonly}] ${title}`) + setTitle(`[${window.siyuan.languages.editReadonly}] ${title}`); } } else { - setTitle(title.replace(`[${window.siyuan.languages.editReadonly}] `, "")) + setTitle(title.replace(`[${window.siyuan.languages.editReadonly}] `, "")); } } if (typeof zoomIn === "boolean") { @@ -310,10 +310,10 @@ export const updateTitle = (readonly?: boolean, zoomIn?: boolean) => { setTitle(`[${window.siyuan.languages.enter}] ${title}`); } } else { - setTitle(title.replace(`[${window.siyuan.languages.enter}] `, "")) + setTitle(title.replace(`[${window.siyuan.languages.enter}] `, "")); } } -} +}; export const downloadProgress = (data: { id: string, percent: number }) => { const bazzarElement = document.getElementById("configBazaarReadme"); diff --git a/app/src/layout/dock/util.ts b/app/src/layout/dock/util.ts index d4ac60b80..6a3dcc658 100644 --- a/app/src/layout/dock/util.ts +++ b/app/src/layout/dock/util.ts @@ -111,4 +111,4 @@ export const renameTag = (labelName: string) => { btnsElement[1].addEventListener("click", () => { fetchPost("/api/tag/renameTag", {oldLabel: labelName, newLabel: inputElement.value}); }); -} +}; diff --git a/app/src/layout/status.ts b/app/src/layout/status.ts index a5c1bd6f4..2a2f4ab18 100644 --- a/app/src/layout/status.ts +++ b/app/src/layout/status.ts @@ -10,7 +10,6 @@ import {getCurrentWindow} from "@electron/remote"; /// #endif /// #endif import {isBrowser} from "../util/functions"; -import {lockScreen} from "../dialog/processSystem"; export const initStatus = () => { /// #if !MOBILE diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 7bf57d183..f75521b06 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -457,8 +457,8 @@ export const resizeTabs = () => { } // 保持光标位置不变 https://ld246.com/article/1673704873983/comment/1673765814595#comments if (!item.element.classList.contains("fn__none") && item.editor.protyle.toolbar.range) { - const protyleRect = item.editor.protyle.element.getBoundingClientRect() - const rangeRect = item.editor.protyle.toolbar.range.getBoundingClientRect() + const protyleRect = item.editor.protyle.element.getBoundingClientRect(); + const rangeRect = item.editor.protyle.toolbar.range.getBoundingClientRect(); if (protyleRect.top + 30 > rangeRect.top || protyleRect.bottom < rangeRect.bottom) { item.editor.protyle.toolbar.range.startContainer.parentElement.scrollIntoView(protyleRect.top > rangeRect.top); } diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index ed53c4b5e..ffb94990e 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -968,7 +968,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => { window.siyuan.menus.menu.append(new MenuItem({ label: window.siyuan.languages.rename, click() { - renameTag(tagElement.textContent.replace(Constants.ZWSP, "")) + renameTag(tagElement.textContent.replace(Constants.ZWSP, "")); } }).element); window.siyuan.menus.menu.append(new MenuItem({ diff --git a/app/src/menus/workspace.ts b/app/src/menus/workspace.ts index ccce69c72..45a0dcc0b 100644 --- a/app/src/menus/workspace.ts +++ b/app/src/menus/workspace.ts @@ -35,7 +35,7 @@ export const workspaceMenu = (rect: DOMRect) => { } }).element); } - const dockMenu: IMenu[] = [] + const dockMenu: IMenu[] = []; getAllDocks().forEach(item => { dockMenu.push({ icon: item.icon, @@ -66,7 +66,7 @@ export const workspaceMenu = (rect: DOMRect) => { } openWorkspace(localPath.filePaths[0]); } - }] + }]; workspaceSubMenu.push({type: "separator"}); response.data.forEach((item: IWorkspace) => { workspaceSubMenu.push(workspaceItem(item) as IMenu);