diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-09-13 13:32:51 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-09-13 13:32:51 +0000 |
| commit | 5a273e74f0fff18df5ab6cb240c9e260be4bb7ff (patch) | |
| tree | 4fbc7e142335d110fa0a984ff2c345a487e37ca4 /addons/mail/static/src/js/thread_windows/thread_window.js | |
| parent | dc5f83b63313018999b598210b972636986c5bea (diff) | |
| parent | fe59754c5201f9392b75d5d4cce8ca1400a7ef5d (diff) | |
[MERGE] forward port branch saas-12.4 up to fe59754c520
closes odoo/odoo#36721
Signed-off-by: Christophe Simonis <chs@odoo.com>
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.js | 44 |
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. */ |
