Skip to content
Snippets Groups Projects
Commit a4f041ed authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

[FIX] mail: display attachment preview

parent 614b40b3
No related branches found
No related tags found
No related merge requests found
......@@ -391,6 +391,14 @@ var ChatterMailThread = form_common.AbstractField.extend(mail_thread.MailThreadM
*/
message_render: function(){
this.$('.o_mail_chatter_messages').html(QWeb.render('mail.chatter.ChatterMailThread.messages', {'widget': this}));
// display image thumbnail
this.$(".o_mail_chatter_messages .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') + "')");
}
});
},
/**
* Order the messages
......
......@@ -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){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment