windingwind

Results 347 comments of windingwind

Yes. There is a `isHidden` property on the argument when creating a menu and by returning a boolean the column is displayed accordingly. Like this: ```ts ztoolkit.Menu.register("collection", { "tag": "menu",...

It's: https://github.com/windingwind/zotero-plugin-toolkit/blob/2aa66e34e51ffc6c5bd20d32dda557c8e41f5171/src/managers/menu.ts#L235-L239

It's called in the event `popupshowing` of its parent popup, and that's where the `ev` comes from

Yes, you can always set the attributes on the `elem`

> How do I get the selected collection inside isHidden? Basically, from the main window's ZoteroPane. There will be an official replacement to the menu API in the future.

```ts ztoolkit.Menu.register("item", { tag: "menu", children: [ { tag: "menuitem", onShowing: (elem, ev) => { if (!elem.dataset.l10nID) { elem.dataset.l10nID = "item-menu-viewAttachment"; } }, isHidden: (elem, ev) => { const selectedItems...

There's no reliable way to insert the menu after this menu item (at least with this lib), as this menu item is dynamically generated. Also, please note that Zotero's official...

The current implementation in this lib will continue working, while Zotero's official API won't support `insertPosition`. Plugins are expected to have their menu items under all of Zotero's built-in menu...