From 79962bd6e2b881f3ab1dc2568c1ab0a9de816537 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 15 Aug 2023 20:37:16 +0800 Subject: [PATCH] :art: search asset --- app/src/menus/index.ts | 5 ++++- app/src/search/assets.ts | 9 --------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/menus/index.ts b/app/src/menus/index.ts index b8e0f9341..0069b4dbe 100644 --- a/app/src/menus/index.ts +++ b/app/src/menus/index.ts @@ -58,7 +58,10 @@ export class Menus { } if (dataType === "search-item") { - initSearchMenu(target.getAttribute("data-node-id")).popup({x: event.clientX, y: event.clientY}); + const nodeId = target.getAttribute("data-node-id"); + if (nodeId) { + initSearchMenu(nodeId).popup({x: event.clientX, y: event.clientY}); + } event.stopPropagation(); break; } diff --git a/app/src/search/assets.ts b/app/src/search/assets.ts index 5fc87167b..523df96f1 100644 --- a/app/src/search/assets.ts +++ b/app/src/search/assets.ts @@ -344,15 +344,6 @@ export const assetMethodMenu = (target: HTMLElement, cb: () => void) => { cb(); } }).element); - window.siyuan.menus.menu.append(new MenuItem({ - iconHTML: Constants.ZWSP, - label: "SQL", - current: method === 2, - click() { - window.siyuan.storage[Constants.LOCAL_SEARCHASSET].method = 2; - cb(); - } - }).element); window.siyuan.menus.menu.append(new MenuItem({ iconHTML: Constants.ZWSP, label: window.siyuan.languages.regex,