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.

29 lines
973 B

  1. /* © 2016 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 core = require('web.core');
  6. var composer = require('mail.composer');
  7. var Chatter = core.form_widget_registry.get('mail_thread');
  8. Chatter.include({
  9. on_open_composer_new_message: function () {
  10. var self = this;
  11. this.open_composer();
  12. // wait for composer input to be initialized
  13. // taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait
  14. function checkVariable() {
  15. if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') {
  16. self.composer.on_open_full_composer();
  17. }
  18. else {
  19. setTimeout(function() {
  20. checkVariable();
  21. }, 50);
  22. }
  23. }
  24. checkVariable();
  25. }
  26. });
  27. });