diff --git a/package-lock.json b/package-lock.json index 687090d..8bcdcc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.2", "license": "AGPL-3.0-or-later", "dependencies": { - "zotero-plugin-toolkit": "^4.0.10" + "zotero-plugin-toolkit": "^4.0.11" }, "devDependencies": { "@eslint/js": "^9.14.0", @@ -8929,9 +8929,9 @@ } }, "node_modules/zotero-plugin-toolkit": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/zotero-plugin-toolkit/-/zotero-plugin-toolkit-4.0.10.tgz", - "integrity": "sha512-zu9v44XKNUJup6fKkqlrZLh4ZpwoVr9m9BBDcby6vbxFop4fKuYJYmFPwC6FST1TT7nZJl0pDpUaZ+fvayaqGg==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/zotero-plugin-toolkit/-/zotero-plugin-toolkit-4.0.11.tgz", + "integrity": "sha512-vDuJ+ARLrELZHL0sZqsAwHA+igrDbJ4DnJ/Bx/cbpJmf+3MB2j+dvBBvz3R+xj5EMTUoQb5XC46HHNm7JWMAuQ==", "dependencies": { "zotero-types": "^2.2.0" }, diff --git a/package.json b/package.json index d6c0710..e59c851 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/modules/menu.ts b/src/modules/menu.ts index 905ebf8..1114318 100644 --- a/src/modules/menu.ts +++ b/src/modules/menu.ts @@ -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; }, }); @@ -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, @@ -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; @@ -55,7 +55,7 @@ function initMenus(win: _ZoteroTypes.MainWindow): void { "checked", getCurrentItemStatus(itemID) ? "true" : "false", ); - return !elem.hidden; + return undefined; }, });