Don't jump the pointer if the user already selected a message during load

(imported from commit 69a3f11059ee4764f1625df7774ff611fff99537)
This commit is contained in:
Keegan McAllister 2012-09-26 17:52:17 -04:00
parent 21d55c152f
commit 9323abddd9
1 changed files with 6 additions and 2 deletions

View File

@ -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)