Code Monkey home page Code Monkey logo

Comments (8)

johndoh avatar johndoh commented on July 26, 2024

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.

thomascube avatar thomascube commented on July 26, 2024

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.

johndoh avatar johndoh commented on July 26, 2024

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.

alecpl avatar alecpl commented on July 26, 2024

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.

alecpl avatar alecpl commented on July 26, 2024

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.

johndoh avatar johndoh commented on July 26, 2024

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.

alecpl avatar alecpl commented on July 26, 2024

Thank you, it fixed all our needs except one. I can't get zipdownload menu working with contextmenu. Steps:

  1. Enable zipdownload plugin
  2. Go to messages list, right-click one, go to "More..." > "Download...", click it.
  3. 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.

johndoh avatar johndoh commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.