Quantcast
Channel: Zimbra :: Forums - Zimlets
Viewing all articles
Browse latest Browse all 171

New Compose Window Menu Item

$
0
0
Hello. I am working on a zimlet that requires me to add another menu item to the compose window. I have the following code which works famously well:

blah.blah.blah..prototype.initializeToolbar =
function(app,toolbar,composeController,viewID)
{
if (viewID.indexOf("COMPOSE") == 0) {
var buttonIndex = 0;
if (this.isInit != 0)
return;
this.isInit++;
var buttonParams = {
text: "My Blah",
tooltip: "Blah Blah",
index: buttonIndex,
image: "zimbraicon"
};

// creates the button with an id and params containing the button details
var button = toolbar.createOp("Blah Blah Blah", buttonParams);
button.addSelectionListener(new AjxListener(this, this.popDialog, composeController));
}

As I said, this all works great UNLESS you compose your email in a new window. If you do that, it turns out initializeToolbar is actually never called. I looked in the code and the culprit seems to be here : (taken from ZmComposeController.js)

if (params.inNewWindow) {
var msgId = params.msg ? params.msg.nId : (this._msg ? this._msg.nId : Dwt.getNextId());
var newWinObj = ac.getNewWindow(false, ZmComposeController.NEW_WINDOW_WIDTH, ZmComposeController.NEW_WINDOW_HEIGHT, ZmId.VIEW_COMPOSE + "_" + msgId);

// this is how child window knows what to do once loading:
newWinObj.command = "compose";
newWinObj.params = params;
if (newWinObj.win) {
newWinObj.win.focus();
}
The new window object never really asks anybody if there are changes to the menu bar.
So my questions is, has anyone been able to figure out a way to add a menu bar to a new compose window?

I am using Zimbra version 7.2.0

Viewing all articles
Browse latest Browse all 171

Trending Articles