Skip to content

Commit

Permalink
Merge pull request #32 from syt2/31-feature-add-icon-in-menu
Browse files Browse the repository at this point in the history
add icon in menu
  • Loading branch information
syt2 authored Mar 27, 2024
2 parents 0918abd + 4056902 commit 2b8466a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/modules/addonTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,19 @@ export class AddonTable {
static registerInMenuTool() {
ztoolkit.Menu.register("menuTools", {
tag: "menuseparator",
id: "addon-table-menuseparator-1"
id: "addon-table-menuseparator"
});
ztoolkit.Menu.register("menuTools", {
tag: "menuitem",
id: "addon-table-entrance",
label: getString("menuitem-addons"),
icon: `chrome://${config.addonRef}/content/icons/favicon.svg`,
commandListener: (event) => {
(async () => {
await this.showAddonsWindow({ from: "menu" });
})();
},
});
ztoolkit.Menu.register("menuTools", {
tag: "menuseparator",
id: "addon-table-menuseparator-2"
});
}

/**
Expand Down Expand Up @@ -95,9 +92,8 @@ export class AddonTable {

static unregisterAll() {
document.querySelector("#zotero-toolbaritem-addons")?.remove();
ztoolkit.Menu.unregister("addon-table-menuseparator-1");
ztoolkit.Menu.unregister("addon-table-menuseparator");
ztoolkit.Menu.unregister("addon-table-entrance");
ztoolkit.Menu.unregister("addon-table-menuseparator-2");
}

/**
Expand Down

0 comments on commit 2b8466a

Please sign in to comment.