mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[9.0] [PORT] web_send_message_popup
This commit is contained in:
29
web_send_message_popup/static/src/js/chatter.js
Normal file
29
web_send_message_popup/static/src/js/chatter.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/* © 2016 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";
|
||||
|
||||
var core = require('web.core');
|
||||
var composer = require('mail.composer');
|
||||
var Chatter = core.form_widget_registry.get('mail_thread');
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
checkVariable();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template>
|
||||
<t t-extend="mail.compose_message">
|
||||
<t t-jquery="a.oe_compose_post:eq(0)" t-operation="replace">
|
||||
<a class="oe_compose_post oe_full" t-if="widget.options.compose_placeholder"><t t-raw="widget.options.compose_placeholder"/></a>
|
||||
</t>
|
||||
<t t-jquery="a.oe_compose_post:eq(1)" t-operation="replace">
|
||||
<a class="oe_compose_post oe_full" t-if="!widget.options.compose_placeholder and !widget.options.view_mailbox">Send a message</a>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
Reference in New Issue
Block a user