You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.0 KiB

  1. /* Copyright 2018 Camptocamp SA
  2. * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
  3. odoo.define('web_send_message_popup.Chatter', function (require) {
  4. "use strict";
  5. var Chatter = require('mail.Chatter');
  6. Chatter.include({
  7. _onOpenComposerMessage: function () {
  8. // wait for composer input to be initialized
  9. // taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait
  10. var self = this;
  11. $.when(this._super.apply(this, arguments)).then(function () {
  12. function checkVariable() {
  13. if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') {
  14. self.composer.on_open_full_composer();
  15. }
  16. else {
  17. setTimeout(function () {
  18. checkVariable();
  19. }, 50);
  20. }
  21. }
  22. checkVariable();
  23. });
  24. }
  25. });
  26. });