mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_send_message_popup: Migration to 14.0
This commit is contained in:
@@ -1,17 +1,27 @@
|
||||
/* Copyright 2019-2021 Camptocamp SA
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||
odoo.define("web_send_message_popup.Chatter", function (require) {
|
||||
odoo.define("web_send_message_popup/static/src/js/chatter.js", function (require) {
|
||||
"use strict";
|
||||
|
||||
var Chatter = require("mail.Chatter");
|
||||
const components = {
|
||||
Composer: require("mail/static/src/components/chatter_topbar/chatter_topbar.js"),
|
||||
};
|
||||
const {patch} = require("web.utils");
|
||||
|
||||
Chatter.include({
|
||||
_onOpenComposerMessage: function () {
|
||||
patch(components.Composer, "web_send_message_popup/static/src/js/chatter.js", {
|
||||
/**
|
||||
* Overwrite to always launch full composer instead of quick messages
|
||||
*/
|
||||
_onClickSendMessage() {
|
||||
this._super.apply(this, arguments);
|
||||
var self = this;
|
||||
this._suggestedPartnersProm.then(function () {
|
||||
self._composer._onOpenFullComposer();
|
||||
});
|
||||
if (
|
||||
this.chatter.composer &&
|
||||
this.chatter.isComposerVisible &&
|
||||
!this.chatter.composer.isLog
|
||||
) {
|
||||
this.chatter.update({isComposerVisible: false});
|
||||
this.chatter.composer.openFullComposer();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user