Pārlūkot izejas kodu

:art: search asset

Vanessa 2 gadi atpakaļ
vecāks
revīzija
79962bd6e2
2 mainītis faili ar 4 papildinājumiem un 10 dzēšanām
  1. 4 1
      app/src/menus/index.ts
  2. 0 9
      app/src/search/assets.ts

+ 4 - 1
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;
                 }

+ 0 - 9
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,