From 03603d6b8f52914710ac179ce4b266cf89eb24ed Mon Sep 17 00:00:00 2001 From: Barry de Graaff Date: Fri, 18 Mar 2016 13:21:11 +0100 Subject: [PATCH] show the print button in new tab/window fix: https://github.com/Zimbra-Community/printpatch-zimlet/issues/1 --- .../tk_barrydegraaff_printpatch.js | 17 +++-------------- .../tk_barrydegraaff_printpatch.xml | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.js b/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.js index c9790d6..b6c2b93 100644 --- a/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.js +++ b/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.js @@ -36,16 +36,6 @@ var PrintpatchZimlet = tk_barrydegraaff_printpatch_HandlerObject; */ PrintpatchZimlet.prototype.init = function() { - AjxPackage.require({name:"MailCore", callback:new AjxCallback(this, this._applyRequestHeaders)}); -}; - -/** - * Applies the request headers. - * Request Zimbra to expose "List-Unsubscribe" header to the Zimlet framework - */ -PrintpatchZimlet.prototype._applyRequestHeaders = -function() { - ZmMailMsg.requestHeaders["List-Unsubscribe"] = "List-Unsubscribe"; }; PrintpatchZimlet.prototype._handlePrintpatchZimletMenuClick = function(controller) { @@ -92,11 +82,10 @@ PrintpatchZimlet.prototype._handlePrintpatchZimletMenuClick = function(controlle }; -PrintpatchZimlet.prototype.onMsgView = function (msg, oldMsg, msgView) { +PrintpatchZimlet.prototype.initializeToolbar = +function(app, toolbar, controller, viewId) { try { - var app = appCtxt.getCurrentApp(); - var controller = app.getMailListController(); var toolbar = controller.getCurrentToolbar(); if (toolbar) { @@ -118,7 +107,7 @@ PrintpatchZimlet.prototype.onMsgView = function (msg, oldMsg, msgView) { tooltip: 'Print email', index: 9, //position of the button image: "zimbraicon", //icon - enabled: true //default if undefined is true, defining it for documentation purpose + enabled: false }; var button = toolbar.createOp("PrintpatchZimletButton", buttonArgs); button.addSelectionListener(new AjxListener(this, this._handlePrintpatchZimletMenuClick, controller)); diff --git a/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.xml b/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.xml index 9d98493..4ab6bd2 100644 --- a/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.xml +++ b/tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.xml @@ -1,4 +1,4 @@ - + tk_barrydegraaff_printpatch.js tk_barrydegraaff_printpatch_HandlerObject