是否可以更改右键单击电子邮件项目行时弹出的上下文菜单(显示在 zimbra 中间面板中的类型)。这是一个例子......
ContentObject 类型很接近,但我似乎找不到任何结论性的东西。
顺便说一句,总 zimbra/zimlet newb 也是。
是的,您绝对可以添加项目。(我只添加了项目,没有删除项目)。基本上,您将把功能放入
onActionMenuInitialized = function(controller, actionMenu) {
// do some stuff here that adds a menu item
// and make sure you add a selection listener to that item.
}
我刚刚用 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);