From 2494412f77d796725e91f425d19ce83b9675b7f8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 25 Apr 2023 10:57:14 +0800 Subject: [PATCH] :rotating_light: --- app/src/history/history.ts | 6 +++--- app/src/layout/dock/Bookmark.ts | 2 +- app/src/menus/bookmark.ts | 4 ++-- app/src/menus/navigation.ts | 4 ++-- app/src/mobile/dock/MobileBookmarks.ts | 2 +- app/src/util/serviceWorker.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/history/history.ts b/app/src/history/history.ts index 87d684aa8..483ed04a5 100644 --- a/app/src/history/history.ts +++ b/app/src/history/history.ts @@ -230,11 +230,11 @@ const renderRepo = (element: Element, currentPage: number) => { }); previousElement.classList.add("fn__none"); nextElement.classList.add("fn__none"); - pageElement.classList.add("fn__none") + pageElement.classList.add("fn__none"); } else { previousElement.classList.remove("fn__none"); nextElement.classList.remove("fn__none"); - pageElement.classList.remove("fn__none") + pageElement.classList.remove("fn__none"); element.setAttribute("data-page", currentPage.toString()); if (currentPage > 1) { previousElement.removeAttribute("disabled"); @@ -514,7 +514,7 @@ const bindEvent = (element: Element, dialog?: Dialog) => { } else if (type === "more") { target.parentElement.parentElement.querySelectorAll(".b3-list-item__meta").forEach(item => { item.classList.toggle("fn__none"); - }) + }); event.stopPropagation(); event.preventDefault(); break; diff --git a/app/src/layout/dock/Bookmark.ts b/app/src/layout/dock/Bookmark.ts index 168fad72c..d2e3b59ad 100644 --- a/app/src/layout/dock/Bookmark.ts +++ b/app/src/layout/dock/Bookmark.ts @@ -89,7 +89,7 @@ export class Bookmark extends Model { } }, rightClick: (element: HTMLElement, event: MouseEvent) => { - openBookmarkMenu(element, event, this) + openBookmarkMenu(element, event, this); }, ctrlClick(element: HTMLElement) { openFileById({ diff --git a/app/src/menus/bookmark.ts b/app/src/menus/bookmark.ts index e1c4ea26a..33471c2ce 100644 --- a/app/src/menus/bookmark.ts +++ b/app/src/menus/bookmark.ts @@ -63,7 +63,7 @@ export const openBookmarkMenu = (element: HTMLElement, event: MouseEvent, bookma confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(bookmarkText)}?`, () => { if (id) { fetchPost("/api/attr/setBlockAttrs", {id, attrs: {bookmark: ""}}, () => { - bookmarkObj.update() + bookmarkObj.update(); }); document.querySelectorAll(`.protyle-wysiwyg [data-node-id="${id}"]`).forEach((item) => { item.setAttribute("bookmark", ""); @@ -81,4 +81,4 @@ export const openBookmarkMenu = (element: HTMLElement, event: MouseEvent, bookma } window.siyuan.menus.menu.element.style.zIndex = "221"; // 移动端被右侧栏遮挡 window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY}); -} +}; diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts index e525eb222..c3f4b2661 100644 --- a/app/src/menus/navigation.ts +++ b/app/src/menus/navigation.ts @@ -402,7 +402,7 @@ export const initFileMenu = (notebookId: string, pathString: string, liElement: icon: "iconSearch", accelerator: window.siyuan.config.keymap.general.search.custom, async click() { - const searchPath = getDisplayName(pathString, false, true) + const searchPath = getDisplayName(pathString, false, true); /// #if MOBILE const response = await fetchSyncPost("/api/filetree/getHPathByPath", { notebook: notebookId, @@ -432,7 +432,7 @@ export const initFileMenu = (notebookId: string, pathString: string, liElement: accelerator: window.siyuan.config.keymap.general.replace.custom, icon: "iconReplace", async click() { - const searchPath = getDisplayName(pathString, false, true) + const searchPath = getDisplayName(pathString, false, true); /// #if MOBILE const response = await fetchSyncPost("/api/filetree/getHPathByPath", { notebook: notebookId, diff --git a/app/src/mobile/dock/MobileBookmarks.ts b/app/src/mobile/dock/MobileBookmarks.ts index e518dfb6d..fc7f26512 100644 --- a/app/src/mobile/dock/MobileBookmarks.ts +++ b/app/src/mobile/dock/MobileBookmarks.ts @@ -32,7 +32,7 @@ export class MobileBookmarks { const id = element.getAttribute("data-node-id"); const actionElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item__action"); if (actionElement) { - openBookmarkMenu(actionElement.parentElement, event, this) + openBookmarkMenu(actionElement.parentElement, event, this); } else { fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => { openMobileFileById(id, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]); diff --git a/app/src/util/serviceWorker.ts b/app/src/util/serviceWorker.ts index e2812a07d..e437249df 100644 --- a/app/src/util/serviceWorker.ts +++ b/app/src/util/serviceWorker.ts @@ -1,5 +1,5 @@ // https://github.com/siyuan-note/siyuan/pull/8012 -export const registerServiceWorker = (scriptURL: string, scope: string = "/", workerType: WorkerType = "module") => { +export const registerServiceWorker = (scriptURL: string, scope = "/", workerType: WorkerType = "module") => { if (!("serviceWorker" in navigator) || typeof (navigator.serviceWorker) === "undefined" || !("caches" in window) || !("fetch" in window)) { return;