diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-12-05 14:35:02 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-12-06 14:51:28 +0000 |
| commit | 7ad45a04e1a368f132fcc83bbe992ce0e98ed3d2 (patch) | |
| tree | 5b106206817e1f73251374879f6d18d174704559 /addons/mail/static/src/js/composers/basic_composer.js | |
| parent | 9117d968e056d7c4e1112079e7e0ea0dd63cf9a5 (diff) | |
[IMP] im_livechat, mail: improved "is typing" notification
With this commit, the UI for "is typing..." notifications
has changed.
** before **:
In Discuss & chat windows, "is typing..." notification bar
at the bottom of the thread, inside the conversation.
** after **
In chat windows, animated '...' next to conversation name.
In Discuss, animated '...' next to conversation name in sidebar,
and text below the composer.
Task-ID 1881001
Diffstat (limited to 'addons/mail/static/src/js/composers/basic_composer.js')
| -rw-r--r-- | addons/mail/static/src/js/composers/basic_composer.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js index c8f7d702af4..1a40e3f48fa 100644 --- a/addons/mail/static/src/js/composers/basic_composer.js +++ b/addons/mail/static/src/js/composers/basic_composer.js @@ -123,6 +123,9 @@ var BasicComposer = Widget.extend({ $(window).on(this.fileuploadID, this._onAttachmentLoaded.bind(this)); this.on('change:attachment_ids', this, this._renderAttachments); + this.call('mail_service', 'getMailBus') + .on('update_typing_partners', this, this._onUpdateTypingPartners); + // Mention this._mentionManager.prependTo(this.$('.o_composer')); @@ -793,6 +796,24 @@ var BasicComposer = Widget.extend({ this._mentionManager.detectDelimiter(); } }, + /** + * @private + * @param {integer|string} threadID + */ + _onUpdateTypingPartners: function (threadID) { + if (!this.options.showTyping) { + return; + } + if (!this.options.thread) { + return; + } + if (this.options.thread.getID() !== threadID) { + return; + } + this.$('.o_composer_thread_typing').html(QWeb.render('mail.Composer.ThreadTyping', { + thread: this.options.thread, + })); + }, }); return BasicComposer; |
