[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)
This commit is contained in:
Mahendra Barad
2017-07-19 11:47:47 +02:00
committed by ged-odoo
parent 6651016ed0
commit 64027f3555
+4
View File
@@ -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');