Skip to content
Permalink
Browse files

[REF] mail: separate button rendering

original PR: #25801

closes #38084

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
  • Loading branch information...
Yajo authored and alexkuhn committed Oct 3, 2019
1 parent d6f4b2c commit 698a4d59c824d0a3441c3109813b631478473779
Showing with 9 additions and 6 deletions.
  1. +9 −6 addons/mail/static/src/js/chatter.js
@@ -65,12 +65,7 @@ var Chatter = Widget.extend(chat_mixin, {
this.$topbar = this.$('.o_chatter_topbar');

// render and append the buttons
this.$topbar.append(QWeb.render('mail.Chatter.Buttons', {
new_message_btn: !!this.fields.thread,
log_note_btn: this.hasLogButton,
schedule_activity_btn: !!this.fields.activity,
isMobile: config.device.isMobile,
}));
this.$topbar.append(this._renderButtons());

// start and append the widgets
var fieldDefs = _.invoke(this.fields, 'appendTo', $('<div>'));
@@ -214,6 +209,14 @@ var Chatter = Widget.extend(chat_mixin, {
}
}).always($spinner.remove.bind($spinner));
},
_renderButtons: function () {
return QWeb.render('mail.Chatter.Buttons', {
new_message_btn: !!this.fields.thread,
log_note_btn: this.hasLogButton,
schedule_activity_btn: !!this.fields.activity,
isMobile: config.device.isMobile,
});
},
_setState: function (record) {
if (!this.record || this.record.res_id !== record.res_id) {
this.context = {

0 comments on commit 698a4d5

Please sign in to comment.
You can’t perform that action at this time.