diff --git a/addons/mail/static/src/js/document_viewer.js b/addons/mail/static/src/js/document_viewer.js index 679e483c899..b3ea0e18bfc 100644 --- a/addons/mail/static/src/js/document_viewer.js +++ b/addons/mail/static/src/js/document_viewer.js @@ -40,9 +40,10 @@ var DocumentViewer = Widget.extend({ init: function (parent, attachments, activeAttachmentID) { this._super.apply(this, arguments); this.attachment = _.filter(attachments, function (attachment) { - var type = attachment.mimetype.split('/').shift(); - if (type === 'image' || type === 'video') { - attachment.type = type; + var match = attachment.mimetype.match("(image|video|application/pdf)"); + + if (match) { + attachment.type = match[1]; return true; } }); diff --git a/addons/mail/static/src/less/composer.less b/addons/mail/static/src/less/composer.less index 4073cef80c2..e32c1167ac2 100644 --- a/addons/mail/static/src/less/composer.less +++ b/addons/mail/static/src/less/composer.less @@ -357,6 +357,12 @@ max-height: 100%; transition: 0.3s cubic-bezier(0, 0, 0.49, 1.6) 0s, opacity 0.15s; } + .o_viewer_pdf { + width: 80%; + height: 90%; + border: 0px; + box-shadow: 1px 1px 20px 1px #000; + } .o_viewer_video { height: 80%; } diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 43cf896e1cc..8237658e99e 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -42,6 +42,7 @@