Browse Source

[FIX] move function toggle() from sent.js to base.js

[FIX] change summary in __openerp__.py
pull/22/head
x620 9 years ago
parent
commit
971ba44447
  1. 2
      mail_archives/__openerp__.py
  2. 9
      mail_base/static/src/js/base.js
  3. 10
      mail_sent/static/src/js/sent.js

2
mail_archives/__openerp__.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
{ {
"name": "Mail archives", "name": "Mail archives",
"summary": """Adds menu to find sent/received messages""",
"summary": """Adds menu to find old messages""",
"category": "Discuss", "category": "Discuss",
"images": [], "images": [],
"version": "1.0.0", "version": "1.0.0",

9
mail_base/static/src/js/base.js

@ -97,6 +97,15 @@ ChatAction.include({
} }
}); });
return result; return result;
},
set_channel: function(channel){
var result = this._super.apply(this, arguments);
var self = this;
return $.when(result).done(function() {
self.$buttons
.find('.o_mail_chat_button_new_message')
.toggle(self.show_send_message_button.indexOf(channel.id) != -1);
});
} }
}); });

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

@ -19,15 +19,9 @@ var _lt = core._lt;
var ChatAction = core.action_registry.get('mail.chat.instant_messaging'); var ChatAction = core.action_registry.get('mail.chat.instant_messaging');
ChatAction.include({ ChatAction.include({
set_channel: function(channel){ set_channel: function(channel){
var result = this._super.apply(this, arguments);
// Add "Send message" button in the Sent menu
this._super.apply(this, arguments);
// Add channel Sent for show "Send message" button
this.show_send_message_button.push('channel_sent'); this.show_send_message_button.push('channel_sent');
var self = this;
return $.when(result).done(function() {
self.$buttons
.find('.o_mail_chat_button_new_message')
.toggle(self.show_send_message_button.indexOf(channel.id) != -1);
});
}, },
get_thread_rendering_options: function (messages) { get_thread_rendering_options: function (messages) {
var options = this._super.apply(this, arguments); var options = this._super.apply(this, arguments);

Loading…
Cancel
Save