Vanessa 2024-04-30 11:53:51 +08:00
parent f76d041d03
commit f375a085ce
2 changed files with 10 additions and 12 deletions

View file

@ -37,14 +37,16 @@ export const commandPanel = (app: App) => {
dialog.element.setAttribute("data-key", Constants.DIALOG_COMMANDPANEL);
const listElement = dialog.element.querySelector("#commands");
/// #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
app.plugins.forEach(plugin => {
plugin.commands.forEach(command => {

View file

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