From 9875164908613b1b522f002463e69f9fdece1c85 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Mon, 5 Nov 2012 18:31:51 -0500 Subject: [PATCH] Select the first ever message the user receives (imported from commit 0fd6fa03175d9787a5e5a93d6172309a5eb47bfc) --- zephyr/static/js/zephyr.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index a46329dd61..25c2fe8e35 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -461,6 +461,11 @@ function add_messages(messages, where) { {then_scroll: true, update_server: false}); } + if ((selected_message_id === -1) && ! have_initial_messages) { + select_message_by_id(message_array[0].id, + {then_scroll: false, update_server: true}); + } + // If we prepended messages, then we need to scroll back to the pointer. // This will mess with the user's scrollwheel use; possibly we should be // more clever here. However (for now) we only prepend on page load,