diff options
Diffstat (limited to 'addons/mail/static/src/js/thread_windows')
| -rw-r--r-- | addons/mail/static/src/js/thread_windows/abstract_thread_window.js | 10 | ||||
| -rw-r--r-- | addons/mail/static/src/js/thread_windows/thread_window.js | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js index 8a8bf3a0077..801a8166787 100644 --- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js +++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js @@ -350,6 +350,16 @@ var AbstractThreadWindow = Widget.extend({ return this._thread.getID(); }, /** + * Tells whether there is focus on this thread. Note that a thread that has + * the focus means the input has focus. + * + * @private + * @returns {boolean} + */ + _hasFocus: function () { + return this.$input.is(':focus'); + }, + /** * Post a message on this thread window, and auto-scroll to the bottom of * the thread. * 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 20c0965205e..86cb3419eb9 100644 --- a/addons/mail/static/src/js/thread_windows/thread_window.js +++ b/addons/mail/static/src/js/thread_windows/thread_window.js @@ -164,11 +164,11 @@ var ThreadWindow = AbstractThreadWindow.extend({ * should scroll to the bottom if it was at the bottom before update * @param {boolean} [options.passively=false] if set, this thread window * becomes passive, so that it is marked as read only when the focus is - * on it. + * on it. Ignore this option if the focus is already on the thread window. */ update: function (options) { var self = this; - if (options.passively) { + if (options.passively && !this._hasFocus()) { this._setPassive(); } var bottomVisible = !this.isFolded() && |
