Re-select the selected message by ID after prepending

(imported from commit 24f6f17bee8c041fce39a710b8b77f14d3ef7dbe)
This commit is contained in:
Keegan McAllister
2012-10-02 18:39:21 -04:00
parent f03efcd788
commit 6cdd1c3e8b

View File

@@ -991,8 +991,12 @@ function add_messages(data) {
// This will mess with the user's scrollwheel use; possibly we should be // 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, // more clever here. However (for now) we only prepend on page load,
// so maybe it's okay. // 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) if (autocomplete_needs_update)
update_autocomplete(); update_autocomplete();