From 65d2f65bbb91583de40bd5c7e56acd40c5eaac83 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Tue, 12 Mar 2013 13:25:37 -0400 Subject: [PATCH] Check if we need to rerender after appending messages to the MessageList Previously, if the pointer was high on the page such that there was a lot of empty space below and the render window was full (a situation we could get into if we're following new messages arriving), a newly recieved message would not be rendered even though it would have been visible on the screen if we had done a rerender. Adding the _maybe_rerender() call to the end of append() ensures that we don't end up in this situation. (imported from commit 925d3cc62e8221b42f1d5ff1788e99c7d07ccc24) --- zephyr/static/js/message_list.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zephyr/static/js/message_list.js b/zephyr/static/js/message_list.js index 8ea8782564..10a51302ed 100644 --- a/zephyr/static/js/message_list.js +++ b/zephyr/static/js/message_list.js @@ -371,6 +371,13 @@ MessageList.prototype = { this._render(slice_to_render, 'bottom'); this._render_win_end += slice_to_render.length; } + + // If the pointer is high on the page such that there is a + // lot of empty space below and the render window is full, a + // newly recieved message should trigger a rerender so that + // the new message, which will appear in the viewable area, + // is rendered. + this._maybe_rerender(); }, prepend: function MessageList_prepend(messages) {