Browse Source

[REF] Create channels_display_subject array which will contain channels name for subject display. get_thread_rendering_options() method moved in base.js. In new modules append channel name to channels_display_subject variable for enable subject display.

pull/22/head
x620 8 years ago
parent
commit
723b3cd6e6
  1. 9
      mail_archives/static/src/js/archives.js
  2. 6
      mail_base/static/src/js/base.js
  3. 10
      mail_sent/static/src/js/sent.js

9
mail_archives/static/src/js/archives.js

@ -18,10 +18,11 @@ var _lt = core._lt;
var ChatAction = core.action_registry.get('mail.chat.instant_messaging');
ChatAction.include({
get_thread_rendering_options: function (messages) {
var options = this._super.apply(this, arguments);
options.display_subject = options.display_subject || this.channel.id === "channel_archive";
return options;
init: function(parent, action, options) {
this._super.apply(this, arguments);
var channel_name = 'channel_archive';
// Add channel Archive for enable "display_subject" option
this.channels_display_subject.push(channel_name);
}
});

6
mail_base/static/src/js/base.js

@ -66,6 +66,7 @@ ChatAction.include({
init: function(parent, action, options) {
this._super.apply(this, arguments);
this.show_send_message_button = ['channel_inbox'];
this.channels_display_subject = [];
},
start: function() {
var result = this._super.apply(this, arguments);
@ -106,6 +107,11 @@ ChatAction.include({
.find('.o_mail_chat_button_new_message')
.toggle(self.show_send_message_button.indexOf(channel.id) != -1);
});
},
get_thread_rendering_options: function (messages) {
var options = this._super.apply(this, arguments);
options.display_subject = options.display_subject || this.channels_display_subject.indexOf(this.channel.id) != -1;
return options;
}
});

10
mail_sent/static/src/js/sent.js

@ -20,13 +20,11 @@ var ChatAction = core.action_registry.get('mail.chat.instant_messaging');
ChatAction.include({
init: function(parent, action, options) {
this._super.apply(this, arguments);
var channel_name = 'channel_sent';
// Add channel Sent for show "Send message" button
this.show_send_message_button.push('channel_sent');
},
get_thread_rendering_options: function (messages) {
var options = this._super.apply(this, arguments);
options.display_subject = options.display_subject || this.channel.id === "channel_sent";
return options;
this.show_send_message_button.push(channel_name);
// Add channel Sent for enable "display_subject" option
this.channels_display_subject.push(channel_name);
}
});

Loading…
Cancel
Save