Zimbra Right Click Zimlet возможен?

Можно ли изменить контекстное меню, которое появляется при щелчке правой кнопкой мыши по строке элемента электронной почты (тип, который отображается на средней панели zimbra). Вот пример ...

Тип ContentObject близок, но я не могу найти ничего убедительного.

Кстати, Total Zimbra / Zimlet newb тоже.


person concept47    schedule 31.07.2014    source источник


Ответы (2)


Да, вы определенно можете добавить элементы. (Я только добавил, а не удалил элементы). По сути, вы собираетесь поместить функциональность в

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.

person KathyA.    schedule 18.08.2014

Я только что проверил это с 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);
person humkins    schedule 14.07.2016