Comments (8)
The contextmenu will now pick up anything that looks like a Roundcube command from the toolbar and use it. The idea is that plugins won't need to do anything extra, the contextmenu will just pick them up.
Are you trying to add an entry to an existing contextmenu (like on the mail screen) or add a whole new contextmenu (add one in to the calender screens)?
from roundcube-contextmenu.
Both, actually.
I see that the commands I add to existing menus in the Roundcube UI get picked up in the context menu but their state (enabled/disabled) isn't updated depending on the record I right-click. For example, I'm adding more address books to the directories list in the address book view and along with them, the options menu gets additional items (e.g. delete address book). These also show up in the context menu but should be disabled when clicking the LDAP address book as this cannot be deleted. The automatic pick-up is good but I'd like a way to interact with the context menu items or register events when a menu is opened with a reference to the actual record.
For whole new screens like a calendar module, I'd prefer a simple API where I can register a contextmenu together with a selector (like 'div.calendarview') and some callbacks when an item is clicked.
Thanks a lot for considering!
from roundcube-contextmenu.
These also show up in the context menu but should be disabled when clicking the LDAP address book as this cannot be deleted. The automatic pick-up is good but I'd like a way to interact with the context menu items or register events when a menu is opened with a reference to the actual record.
I have made some improvements to that recently. Could try with the git-master version of this plugin (needs git-master rc) and see if its any better? If it still doesn't pick it up right is there any chance that I could borrow your plugin - just to save me making a similar one for testing?
For whole new screens like a calendar module, I'd prefer a simple API where I can register a contextmenu together with a selector (like 'div.calendarview') and some callbacks when an item is clicked.
It should be possible now but it needs documenting. I'll work on that.
from roundcube-contextmenu.
Still wrong. They're picked up into wrong place. E.g. in kolab_addressbook plugin new actions/buttons are added to "More actions" menu. So, now they appear in contextmenu when you click on group record, but not when you click on addressbook record. In this case automatic handling is wrong and we need manual method. Also, we most likely would like to have a possibility to force contextmenu to skip some buttons, e.g. using some class name on link element.
from roundcube-contextmenu.
Even If we assume the actions are picked up correctly, they still are not activated. Is there a way to bind to afteractivate event or any other on an existing menu? I don't see such an option.
from roundcube-contextmenu.
The first version of the manual is now available in the repo. It covers issues raised here like:
- how to add your own menu to a screen
- how to add items to an existing menu
- how to enable/disable menu items
- how to perform actions when an item is clicked
from roundcube-contextmenu.
Thank you, it fixed all our needs except one. I can't get zipdownload menu working with contextmenu. Steps:
- Enable zipdownload plugin
- Go to messages list, right-click one, go to "More..." > "Download...", click it.
- You should see a submenu with three items.
I don't know how to modify the zipdownload plugin to set correctly command states to activate its menu items. I use messages list 'select' event to do this, but contextmenu "calls" it twice. And for the second time no messages are selected, which makes actions disabled. Any ideas?
I see that 'menu-close' event is not executed when the contextmenu is being hidden.
from roundcube-contextmenu.
I see what you mean. I can make the zipdownload plugin work with this patch but I'm not sure its the best solution. It would be good to make contextmenu somehow enable the commands on its own, right now I just can't see how - I think its to do with it being a plugin rather than a built in command the whole process is just different.
from roundcube-contextmenu.
Related Issues (20)
- Context-menu frontend error HOT 5
- Visual issue with a selected message HOT 2
- Elastic: Menu sometimes does not disappear HOT 3
- Custom menu on a treelist stopped working HOT 1
- Use browser.menus API HOT 2
- Emptying a folder with unread messages via context menu doesn't remove unread message badge HOT 4
- Option to empty a folder containing messages (e.g. Trash) is sometimes greyed out HOT 2
- Add slovak translation HOT 2
- Version check failed HOT 3
- Need help with a bug HOT 2
- Zipdownload menu items not active HOT 2
- PHP Notice in log HOT 1
- Installed correctly but not working... HOT 11
- How to use skip_commands ? HOT 1
- how to turn backgrou menu from oscure almost black to white? HOT 1
- Request HOT 2
- Roundcube 1.5-beta and PHP 8 support HOT 1
- How to pass an argument to my command/function? HOT 1
- First have to left click HOT 6
- 404 errors trying to fetch plugin css/js (v3.3.1) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roundcube-contextmenu.