mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
Re-select the selected message by ID after prepending
(imported from commit 24f6f17bee8c041fce39a710b8b77f14d3ef7dbe)
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user