瀏覽代碼

:sparkles: https://github.com/siyuan-note/siyuan/issues/11133

Vanessa 1 年之前
父節點
當前提交
f375a085ce
共有 2 個文件被更改,包括 10 次插入12 次删除
  1. 10 8
      app/src/boot/globalEvent/commandPanel.ts
  2. 0 4
      app/src/layout/dock/Files.ts

+ 10 - 8
app/src/boot/globalEvent/commandPanel.ts

@@ -37,14 +37,16 @@ export const commandPanel = (app: App) => {
     dialog.element.setAttribute("data-key", Constants.DIALOG_COMMANDPANEL);
     dialog.element.setAttribute("data-key", Constants.DIALOG_COMMANDPANEL);
     const listElement = dialog.element.querySelector("#commands");
     const listElement = dialog.element.querySelector("#commands");
     /// #if !MOBILE
     /// #if !MOBILE
-//     let html = ""
-//     Object.keys(window.siyuan.config.keymap.general).forEach((key) => {
-//         html += `<li class="b3-list-item" data-command="${key}">
-//     <span class="b3-list-item__text">${window.siyuan.languages[key]}</span>
-//     <span class="b3-list-item__meta${isMobile() ? " fn__none" : ""}">${updateHotkeyTip(window.siyuan.config.keymap.general[key].custom)}</span>
-// </li>`;
-//     });
-//     listElement.insertAdjacentHTML("beforeend", html);
+    let html = ""
+    Object.keys(window.siyuan.config.keymap.general).forEach((key) => {
+        if (["addToDatabase"].includes(key)) {
+            html += `<li class="b3-list-item" data-command="${key}">
+    <span class="b3-list-item__text">${window.siyuan.languages[key]}</span>
+    <span class="b3-list-item__meta${isMobile() ? " fn__none" : ""}">${updateHotkeyTip(window.siyuan.config.keymap.general[key].custom)}</span>
+</li>`;
+        }
+    });
+    listElement.insertAdjacentHTML("beforeend", html);
     /// #endif
     /// #endif
     app.plugins.forEach(plugin => {
     app.plugins.forEach(plugin => {
         plugin.commands.forEach(command => {
         plugin.commands.forEach(command => {

+ 0 - 4
app/src/layout/dock/Files.ts

@@ -360,10 +360,6 @@ export class Files extends Model {
                     }
                     }
                     target = target.parentElement;
                     target = target.parentElement;
                 }
                 }
-            } else {
-                this.element.querySelectorAll(".b3-list-item--focus").forEach((item: HTMLElement) => {
-                    item.classList.remove("b3-list-item--focus");
-                });
             }
             }
             if (needFocus) {
             if (needFocus) {
                 setPanelFocus(this.element.parentElement);
                 setPanelFocus(this.element.parentElement);