[FIX] mail: display attachment preview
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user