From 197d4b597c3117dc7ffe2089bc5ee694dfd0cf0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 11 Jun 2014 10:10:15 +0200 Subject: [PATCH] [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. --- addons/mail/static/src/js/mail.js | 6 ++---- 1 file 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); }