Skip to content

Commit

Permalink
fix: menuitem checkbox icon
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Nov 18, 2024
1 parent 541046d commit c3ab5c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"update-deps": "npm update --save"
},
"dependencies": {
"zotero-plugin-toolkit": "^4.0.10"
"zotero-plugin-toolkit": "^4.0.11"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
Expand Down
8 changes: 4 additions & 4 deletions src/modules/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ function initMenus(win: _ZoteroTypes.MainWindow): void {
id: `${addon.data.config.addonRef}-menu-view-enable-bionic`,
classList: ["menu-type-reader", "pdf"],
label: getString("menu-enableBionic"),
type: "checkbox",
commandListener: () => {
setPref("enableBionicReader", !getPref("enableBionicReader"));
},
getVisibility(elem, ev) {
elem.setAttribute("type", "checkbox");
elem.setAttribute(
"checked",
getPref("enableBionicReader") ? "true" : "false",
);
return !elem.hidden;
return undefined;
},
});

Expand All @@ -34,6 +34,7 @@ function initMenus(win: _ZoteroTypes.MainWindow): void {
id: `${addon.data.config.addonRef}-menu-view-enable-bionic-current-item`,
classList: ["menu-type-reader", "pdf"],
label: getString("menu-enableBionicForCurrentItem"),
type: "checkbox",
commandListener: () => {
const itemID = Zotero.Reader.getByTabID(
win.Zotero_Tabs.selectedID,
Expand All @@ -44,7 +45,6 @@ function initMenus(win: _ZoteroTypes.MainWindow): void {
toggleCurrentItemStatus(itemID);
},
getVisibility(elem, ev) {
elem.setAttribute("type", "checkbox");
const itemID = Zotero.Reader.getByTabID(
win.Zotero_Tabs.selectedID,
).itemID;
Expand All @@ -55,7 +55,7 @@ function initMenus(win: _ZoteroTypes.MainWindow): void {
"checked",
getCurrentItemStatus(itemID) ? "true" : "false",
);
return !elem.hidden;
return undefined;
},
});

Expand Down

0 comments on commit c3ab5c4

Please sign in to comment.