[11.0][MIG] web_send_message_popup: Migrate to 11.0

This commit is contained in:
Artem Kostyuk
2018-09-28 17:42:15 +03:00
committed by Du-ma
parent 503a6f667e
commit 4f16a1c7b0
9 changed files with 56 additions and 118 deletions

View File

@@ -1,29 +1,28 @@
/* © 2016 Camptocamp SA
/* Copyright 2018 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";
"use strict";
var core = require('web.core');
var composer = require('mail.composer');
var Chatter = core.form_widget_registry.get('mail_thread');
var Chatter = require('mail.Chatter');
Chatter.include({
on_open_composer_new_message: function () {
var self = this;
this.open_composer();
// wait for composer input to be initialized
// taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait
function checkVariable() {
if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') {
self.composer.on_open_full_composer();
}
else {
setTimeout(function() {
checkVariable();
}, 50);
}
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();
});
}
checkVariable();
}
});
});
});