From 2447ed07a75bde52ec644c8236242ac6cb15ea8f Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 29 Oct 2012 16:13:27 +0100 Subject: [PATCH] [FIX] mail: display vote bzr revid: chm@openerp.com-20121029151327-cptuukjtkrh06bij --- addons/mail/static/src/js/mail.js | 19 +++++++++---------- addons/mail/static/src/xml/mail.xml | 3 +-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9133e5d..86211c5 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -800,12 +800,12 @@ openerp.mail = function (session) { */ on_vote: function (event) { event.stopPropagation(); - var self=this; - return this.ds_message.call('vote_toggle', [[self.id]]).pipe(function (vote) { - self.has_voted = vote; - self.vote_nb += self.has_voted ? 1 : -1; - self.display_vote(); - }); + return this.ds_message.call('vote_toggle', [[this.id]]).pipe( + _.bind(function (vote) { + this.has_voted = vote; + this.vote_nb += this.has_voted ? 1 : -1; + this.display_vote(); + }, this)); return false; }, @@ -813,10 +813,9 @@ openerp.mail = function (session) { * Display the render of this message's vote */ display_vote: function () { - var self = this; - var vote_element = session.web.qweb.render('mail.thread.message.vote', {'widget': self}); - self.$(".oe_msg_vote:first").remove(); - self.$(".oe_mail_vote_count:first").replaceWith(vote_element); + var vote_element = session.web.qweb.render('mail.thread.message.vote', {'widget': this}); + this.$(".oe_msg_footer:first .oe_mail_vote_count").remove(); + this.$(".oe_msg_footer:first .oe_msg_vote").replaceWith(vote_element); }, /** diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index caa85cd..1a40fbc 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -257,12 +257,11 @@ Template used to display Like/Unlike in a mail.message --> - 8 - + like unlike -- 1.7.10.4