mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
Don't jump the pointer if the user already selected a message during load
(imported from commit 69a3f11059ee4764f1625df7774ff611fff99537)
This commit is contained in:
@@ -307,7 +307,7 @@ $(function () {
|
|||||||
$("#current_settings form").ajaxForm(options);
|
$("#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 selected_zephyr; // = get_zephyr_row(selected_zephyr_id)
|
||||||
var last_received = -1;
|
var last_received = -1;
|
||||||
|
|
||||||
@@ -777,8 +777,12 @@ function add_messages(zephyrs) {
|
|||||||
|
|
||||||
$.each(zephyrs, function () {
|
$.each(zephyrs, function () {
|
||||||
zephyr_array.push(this);
|
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);
|
select_and_show_by_id(initial_pointer);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (autocomplete_needs_update)
|
if (autocomplete_needs_update)
|
||||||
|
|||||||
Reference in New Issue
Block a user