0

Is it possible to change the context menu that pops up on right clicking an email item row (the type that shows up in the middle panel of zimbra). Here's an example ...

The ContentObject Type is close but I can't seem to find anything conclusive.

Total zimbra/zimlet newb too btw.

Charles
  • 50,943
  • 13
  • 104
  • 142
concept47
  • 30,257
  • 12
  • 52
  • 74

2 Answers2

1

Yes, you can definitely add items. (I've only added, not deleted items). Basically, you're going to put the functionality in

onActionMenuInitialized = function(controller, actionMenu) {
  // do some stuff here that adds a menu item
  // and make sure you add a selection listener to that item.
}

There's an example you can follow at the Zimbra forum.

KathyA.
  • 671
  • 6
  • 14
0

I've just checked this with Zimbra 8.6.0.

// You should run this code after "Mail" app initialization
// (after its tab activation if you want to check this manually via browser console or
// after "app launched" event notification in your zimlet, see ZmZimletBase.prototype.appLaunch documentation)

var ml = DwtControl.ALL_BY_ID["zl__CLV-main"];

var menu = new ZmPopupMenu(ml);
var mi = menu.createMenuItem("some_id", {text: "Click me"});
mi.addSelectionListener(new AjxListener(null, function(){ console.log("you've just clicked 'Click me' menu item") }));
menu.createSeparator();
mi = menu.createMenuItem("another_id", {text: "Another action"});
mi.addSelectionListener(new AjxListener(null, function(){ console.log("you've just clicked 'Another action' menu item") }));

var listeners = ml._evtMgr._listeners[ZmEvent.S_ACTION];
listeners.removeAll();
var listener = new AjxListener(null, function(ev) {
    menu.setLocation(ev.docX, ev.docY);
    menu.popup();
});
listeners.add(listener);
humkins
  • 9,635
  • 11
  • 57
  • 75