diff options
| author | Christophe Matthieu <chm@odoo.com> | 2015-09-10 15:33:00 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2015-09-11 11:07:07 +0200 |
| commit | a4f041ed455fcf9d82e642cfedfa09d061506352 (patch) | |
| tree | 7c18f6ff9d1bbd1c59cd6663558b66ecd6f8425b /addons/mail/static/src/js/mail_thread.js | |
| parent | 614b40b30497b15e931389f8b8d45e48d2156d24 (diff) | |
[FIX] mail: display attachment preview
Diffstat (limited to 'addons/mail/static/src/js/mail_thread.js')
| -rw-r--r-- | addons/mail/static/src/js/mail_thread.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/mail_thread.js b/addons/mail/static/src/js/mail_thread.js index fbc3fd27f68..165fa015efe 100644 --- a/addons/mail/static/src/js/mail_thread.js +++ b/addons/mail/static/src/js/mail_thread.js @@ -281,6 +281,14 @@ var MailComposeMessage = Widget.extend({ }, attachment_render: function(){ this.$attachments_list.html(QWeb.render('mail.ComposeMessage.attachments', {'widget': this})); + + // display image thumbnail + this.$attachments_list.find(".o_image[data-mimetype^='image']").each(function () { + var $img = $(this); + if (/gif|jpe|jpg|png/.test($img.data('mimetype')) && $img.data('src')) { + $img.css('background-image', "url('" + $img.data('src') + "')"); + } + }); }, // Mention on_click_mention_item: function(event){ |
