From 64027f3555c850277d17e35598406d8eb79eb2c8 Mon Sep 17 00:00:00 2001 From: Mahendra Barad Date: Wed, 19 Jul 2017 15:17:47 +0530 Subject: [PATCH] [FIX] mail: fix wrong adjustment in the chat window In the chat, there is an indication of when a message was sent, This indication gets updated as time passes. When the last one in the conversation is updated to an indication that takes more space (e.g. from 'now' to 'a minute ago'), the text below is pushed lower (as expected) but the chatter does not scroll down. As a result, we do not see new messages, unless manually scrolling down. (PR #17469) --- addons/mail/static/src/js/thread.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index 2176eff55fa..038bbf93de9 100644 --- a/addons/mail/static/src/js/thread.js +++ b/addons/mail/static/src/js/thread.js @@ -193,10 +193,14 @@ var Thread = Widget.extend({ }); }, update_timestamps: function () { + var isAtBottom = this.is_at_bottom(); this.$('.o_mail_timestamp').each(function() { var date = $(this).data('date'); $(this).html(time_from_now(date)); }); + if (isAtBottom && !this.is_at_bottom()) { + this.scroll_to(); + } }, on_click_redirect: function (event) { var id = $(event.target).data('oe-id');