View Single Post
  #2 (permalink)  
Old 10-21-2009, 05:04 PM
sdouglass sdouglass is offline
Intermediate Member
 
Posts: 22
Default

OK, I got the button to show up! This is kind of cool. There is some kind of initialization event notification for Zimlets now, as seen in this line of ZmComposeController.js:

appCtxt.notifyZimlets("initializeToolbar", [this._app, tb, this, this.viewId], {waitUntilLoaded:true});

All I had to do was move my code into a method of my Zimlet named "initializeToolbar" and it got called at the right time and was passed references to the right app, controller, toolbar, and view id.

My_Zimlet.prototype.initializeToolbar =
function(app, toolbar, composeController, viewId) {
// check view id, apparently this event is fired for all toolbars, not just compose toolbar
if (viewId.indexOf(ZmId.VIEW_COMPOSE) == 0) {
// code for modifying the compose toolbar here
}
}

Last edited by sdouglass; 10-21-2009 at 06:31 PM..
Reply With Quote