From d007da8e79e02a741c0a71ce37a9c41d6a833032 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 16 Apr 2014 17:16:42 +0000 Subject: [PATCH] Fix print styling for mail Display popup --- mail/js/app.js | 21 ++++++++++++++++++++- mail/templates/default/app.css | 27 +++++++++++++++++++++++++++ mail/templates/default/display.xet | 1 + mail/templates/pixelegg/app.css | 26 ++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/mail/js/app.js b/mail/js/app.js index 6bfb6c15c2..c4d22c8181 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2899,7 +2899,26 @@ app.classes.mail = AppJS.extend( */ mail_print: function(_action, _senders) { - this.egw.message('Not yet implemented ;-)'); + + var mainIframe = jQuery('#mail-display_mailDisplayBodySrc'); + + if (jQuery('#tempPrintDiv').length == 0) + { + var tmpPrintDiv = jQuery(document.createElement('div')) + .attr('id', 'tempPrintDiv') + .addClass('tmpPrintDiv'); + if (mainIframe) + { + tmpPrintDiv[0].innerHTML = mainIframe.contents().find('body').html(); + } + + jQuery('#mail-display_mailDisplayBodySrc').after(tmpPrintDiv); + + tmpPrintDiv.find('#divAppboxHeader').remove(); + } + + this.egw.message('Printing....'); + this.egw.window.print(); } }); diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index 2a921f6eb1..1eb2aee146 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -668,3 +668,30 @@ div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible { height: 500px; overflow: auto; } + +/* MAIL PRINT */ +@media print { + .mailDisplayHeaders { + border-bottom: 0.1em solid #d7d7d7; + padding-top: 4px; + padding-bottom: 4px; + } + #mail-display_mailDisplayBodySrc { + display: none; + } + .tmpPrintDiv { + margin-top: 10px; + margin-bottom: 30px; + } + .mailDisplayContainer { + border: none; + overflow: visible; + position: static; + } + .mailDisplayAttachments, #mail-display_mail_displayattachments { + display: none; + border: none; + position: inherit; + } + +} diff --git a/mail/templates/default/display.xet b/mail/templates/default/display.xet index 8ac3d3e967..d9142029fa 100644 --- a/mail/templates/default/display.xet +++ b/mail/templates/default/display.xet @@ -2,6 +2,7 @@