summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/document_viewer.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/js/document_viewer.js')
-rw-r--r--addons/mail/static/src/js/document_viewer.js7
1 files changed, 4 insertions, 3 deletions
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;
}
});