-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to have a dynamic context submenu menu on the collection menu? #74
Comments
Yes. There is a ztoolkit.Menu.register("collection", {
"tag": "menu",
"children": [
{
"tag": "menuitem",
"isHidden": (elem, ev) => {
return false;
}
}
]
}) |
What are elem and ev? |
It's: zotero-plugin-toolkit/src/managers/menu.ts Lines 235 to 239 in 2aa66e3
|
It's called in the event |
That will allow a set number of menu items to be shown or hidden I think, but I don't know in advance how many there will be, it's dynamic. |
Oh and the label would be dynamic too. |
Yes, you can always set the attributes on the |
But a fixed number of items then, correct? |
How do I get the selected collection inside isHidden? |
I have a submenu that wants to display a variable set of menitems, dependent on the collection that was right-clicked. Is that possible?
The text was updated successfully, but these errors were encountered: