From e33bcf5e0256198dd77aa385f8d8e98d8b7b7be9 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 17 Oct 2012 17:17:15 +0200 Subject: [PATCH] [IMP]mail: js/dom ok bzr revid: chm@openerp.com-20121017151715-hh08mpd57dcj6o2d --- addons/mail/static/src/js/mail.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 62de7bf3842..d58ac1cd8af 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -148,10 +148,7 @@ openerp.mail = function(session) { start: function(){ this.display_attachments(); this.bind_events(); - - //load avatar img - var user_avatar = mail.ChatterUtils.get_image(this.session, 'res.users', 'image_small', this.session.uid); - this.$('img.oe_mail_icon').attr('src', user_avatar); + this.display_user_avatar(); }, /* upload the file on the server, add in the attachments list and reload display @@ -353,6 +350,11 @@ openerp.mail = function(session) { return true; } }, + + display_user_avatar: function () { + var avatar = mail.ChatterUtils.get_image(this.session, 'res.users', 'image_small', this.session.uid); + return this.$('img.oe_msg_icon').attr('src', avatar); + }, }); /** @@ -862,11 +864,6 @@ openerp.mail = function(session) { start: function() { this._super.apply(this, arguments); - - this.more_msg = this.$(">.oe_msg_more_message:first"); - - this.display_user_avatar(); - this.bind_events(); }, @@ -1159,11 +1156,6 @@ openerp.mail = function(session) { return message }, - - display_user_avatar: function () { - var avatar = mail.ChatterUtils.get_image(this.session, 'res.users', 'image_small', this.session.uid); - return this.$('img.oe_mail_icon').attr('src', avatar); - }, /* Send the records to his parent thread */ switch_new_message: function(records) {