Browse Source

[IMP] add 'search_default_' handler to class ChatAction

pull/6/head
x620 9 years ago
parent
commit
a7f38bedf9
  1. 22
      mail_base/static/src/js/base.js

22
mail_base/static/src/js/base.js

@ -60,6 +60,28 @@ var channel_seen = _.throttle(function (channel) {
return ChannelModel.call('channel_seen', [[channel.id]], {}, {shadow: true}); return ChannelModel.call('channel_seen', [[channel.id]], {}, {shadow: true});
}, 3000); }, 3000);
var ChatAction = core.action_registry.get('mail.chat.instant_messaging');
ChatAction.include({
start: function() {
var result = this._super.apply(this, arguments);
var search_defaults = {};
var context = this.action ? this.action.context : [];
_.each(context, function (value, key) {
var match = /^search_default_(.*)$/.exec(key);
if (match) {
search_defaults[match[1]] = value;
}
});
this.searchview.defaults = search_defaults;
var self = this;
$.when(result).done(function() {
self.searchview.do_search();
});
}
});
var MailTools = core.Class.extend({ var MailTools = core.Class.extend({
send_native_notification: function (title, content) { send_native_notification: function (title, content) {

Loading…
Cancel
Save