summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/thread_windows/thread_window.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-08-30 17:20:28 +0200
committerChristophe Simonis <chs@odoo.com>2019-08-30 17:20:28 +0200
commit545e6d20344f37081ccd6c6e788ea1c5383717af (patch)
tree7786f6001919ea18792c35c4f769336ef991fd3a /addons/mail/static/src/js/thread_windows/thread_window.js
parent513545cdbdf95ae61c068270ab61eec8b81c9bd8 (diff)
parent52f6e38cea8ff9d16ab3432b3ccf032472e5a666 (diff)
[MERGE] forward port branch 12.0 up to 52f6e38cea8
Diffstat (limited to 'addons/mail/static/src/js/thread_windows/thread_window.js')
-rw-r--r--addons/mail/static/src/js/thread_windows/thread_window.js44
1 files changed, 18 insertions, 26 deletions
diff --git a/addons/mail/static/src/js/thread_windows/thread_window.js b/addons/mail/static/src/js/thread_windows/thread_window.js
index 16d5cd31c86..08671354a3e 100644
--- a/addons/mail/static/src/js/thread_windows/thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/thread_window.js
@@ -3,7 +3,9 @@ odoo.define('mail.ThreadWindow', function (require) {
var AbstractThreadWindow = require('mail.AbstractThreadWindow');
var BasicComposer = require('mail.composer.Basic');
+var ExtendedComposer = require('mail.composer.Extended');
+var config = require('web.config');
var core = require('web.core');
var QWeb = core.qweb;
@@ -65,19 +67,27 @@ var ThreadWindow = AbstractThreadWindow.extend({
if (!this.hasThread()) {
this._startWithoutThread();
} else if (this.needsComposer()) {
- var basicComposer = new BasicComposer(this, {
+ var composer;
+ var composerParams = {
mentionPartnersRestricted: this._thread.getType() !== 'document_thread',
- isMini: true,
thread: this._thread,
- });
- basicComposer.on('post_message', this, this._postMessage);
- basicComposer.once('input_focused', this, function () {
+ };
+ if (
+ config.device.isMobile &&
+ this._thread.isMassMailing()
+ ) {
+ composer = new ExtendedComposer(this, composerParams);
+ } else {
+ composer = new BasicComposer(this, _.extend({ isMini: true }, composerParams));
+ }
+ composer.on('post_message', this, this._postMessage);
+ composer.once('input_focused', this, function () {
var commands = this._thread.getCommands();
var partners = this._thread.getMentionPartnerSuggestions();
- basicComposer.mentionSetCommands(commands);
- basicComposer.mentionSetPrefetchedPartners(partners);
+ composer.mentionSetCommands(commands);
+ composer.mentionSetPrefetchedPartners(partners);
});
- composerDef = basicComposer.replace(this.$('.o_thread_composer'));
+ composerDef = composer.replace(this.$('.o_thread_composer'));
composerDef.then(function () {
self.$input = self.$('.o_composer_text_field');
});
@@ -130,24 +140,6 @@ var ThreadWindow = AbstractThreadWindow.extend({
return this._passive;
},
/**
- * States whether the input of the thread window should be displayed or not.
- * This is based on the type of the thread:
- *
- * Do not display the input in the following cases:
- *
- * - no thread related to this window
- * - window of a mailbox (temp: let us have mailboxes in window mode)
- * - window of a thread with mass mailing
- *
- * Any other threads show the input in the window.
- *
- * @override
- * @returns {boolean}
- */
- needsComposer: function () {
- return this._super() && !this._thread.isMassMailing();
- },
- /**
* Turn the thread window in active mode, so that when the bottom of the
* thread is visible, it is automatically marked as read.
*/