Vanessa 2024-10-17 16:19:40 +08:00
parent 054263d8e9
commit 24bdef92ea

View file

@ -77,16 +77,17 @@ export const commandPanel = (app: App) => {
plugin.commands.forEach(command => {
const liElement = document.createElement("li");
liElement.classList.add("b3-list-item");
liElement.dataset.command = command.langKey;
liElement.innerHTML = `<span class="b3-list-item__text">${plugin.displayName}: ${command.langText || plugin.i18n[command.langKey]}</span>
<span class="b3-list-item__meta${isMobile() ? " fn__none" : ""}">${updateHotkeyTip(command.customHotkey)}</span>`;
liElement.addEventListener("click", () => {
liElement.addEventListener("click", (event) => {
if (command.callback) {
command.callback();
} else if (command.globalCallback) {
command.globalCallback();
}
dialog.destroy();
event.preventDefault();
event.stopPropagation();
});
listElement.insertAdjacentElement("beforeend", liElement);
});