Maintainers
+Maintainers
This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose diff --git a/web_send_message_popup/static/src/js/chatter.js b/web_send_message_popup/static/src/js/chatter.js index 89f88544b..929b77733 100644 --- a/web_send_message_popup/static/src/js/chatter.js +++ b/web_send_message_popup/static/src/js/chatter.js @@ -1,4 +1,4 @@ -/* Copyright 2018 Camptocamp SA +/* Copyright 2019 Camptocamp SA * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ odoo.define('web_send_message_popup.Chatter', function (require) { "use strict"; @@ -7,22 +7,11 @@ odoo.define('web_send_message_popup.Chatter', function (require) { Chatter.include({ _onOpenComposerMessage: function () { - // wait for composer input to be initialized - // taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait - var self = this; - $.when(this._super.apply(this, arguments)).then(function () { - function checkVariable() { - if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') { - self.composer.on_open_full_composer(); - } - else { - setTimeout(function () { - checkVariable(); - }, 50); - } - } - checkVariable(); - }); - } + this._super.apply(this, arguments); + this.suggested_partners_def.done($.proxy(function () { + this._closeComposer(true); + this.composer.on_open_full_composer(); + }, this)); + }, }); });