summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2014-06-11 10:10:15 +0200
committerGéry Debongnie <ged@odoo.com>2014-06-11 10:10:15 +0200
commit197d4b597c3117dc7ffe2089bc5ee694dfd0cf0b (patch)
treef8b7972ed185bd4410728cafb6f0c1c5022a7068
parent6def4a6c302abe7d407cd263f0a7e765dbefa1e2 (diff)
[FIX] fix a callback that was not triggered
The problem was that the do_searchview_search callback was registered after the event 'search_data' was triggered. For some reason, it waited that the searchview was appended instead of registering directly.
-rw-r--r--addons/mail/static/src/js/mail.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 4cc0c9a6dd3..04e99f5de0e 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -1915,13 +1915,11 @@ openerp.mail = function (session) {
* @param {Object} defaults ??
*/
load_searchview: function (defaults) {
- var self = this;
var ds_msg = new session.web.DataSetSearch(this, 'mail.message');
this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, false);
-
+ this.searchview.on('search_data', this, this.do_searchview_search);
this.searchview.appendTo(this.$('.oe_view_manager_view_search'),
- this.$('.oe_searchview_drawer_container'))
- .then(function () { self.searchview.on('search_data', self, self.do_searchview_search); });
+ this.$('.oe_searchview_drawer_container'));
if (this.searchview.has_defaults) {
this.searchview.ready.then(this.searchview.do_search);
}