From 6cdd1c3e8b6c7cc6c6b9ca1b6ecaaa5ed23dfb83 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Tue, 2 Oct 2012 18:39:21 -0400 Subject: [PATCH] Re-select the selected message by ID after prepending (imported from commit 24f6f17bee8c041fce39a710b8b77f14d3ef7dbe) --- zephyr/static/js/zephyr.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index a29e14c446..91c0227022 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -991,8 +991,12 @@ function add_messages(data) { // 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, // so maybe it's okay. - if (data.where === 'top') - scroll_to_selected(); + // + // We also need to re-select the message by ID, because we might have + // removed and re-added the row as part of prepend collapsing. + if ((data.where === 'top') && (selected_zephyr_id >= 0)) { + select_and_show_by_id(selected_zephyr_id); + } if (autocomplete_needs_update) update_autocomplete();