mirror of https://github.com/zulip/zulip.git
Don't jump the pointer if the user already selected a message during load
(imported from commit 69a3f11059ee4764f1625df7774ff611fff99537)
This commit is contained in:
parent
21d55c152f
commit
9323abddd9
|
@ -307,7 +307,7 @@ $(function () {
|
|||
$("#current_settings form").ajaxForm(options);
|
||||
});
|
||||
|
||||
var selected_zephyr_id = 0; /* to be filled in on document.ready */
|
||||
var selected_zephyr_id = -1; /* to be filled in on document.ready */
|
||||
var selected_zephyr; // = get_zephyr_row(selected_zephyr_id)
|
||||
var last_received = -1;
|
||||
|
||||
|
@ -777,8 +777,12 @@ function add_messages(zephyrs) {
|
|||
|
||||
$.each(zephyrs, function () {
|
||||
zephyr_array.push(this);
|
||||
if (this.id === initial_pointer)
|
||||
|
||||
// If we received the initially selected message, select it on the client side,
|
||||
// but not if the user has already selected another one during load.
|
||||
if ((this.id === initial_pointer) && (selected_zephyr_id === -1)) {
|
||||
select_and_show_by_id(initial_pointer);
|
||||
}
|
||||
});
|
||||
|
||||
if (autocomplete_needs_update)
|
||||
|
|
Loading…
Reference in New Issue