From 8b3cd91d39cc48413764b0da3fba570edffc6c79 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Thu, 18 Jul 2013 17:36:04 -0400 Subject: [PATCH] Don't save the pointer on reload if we don't have one. This fixes the bug where the pointer jumps to the top if it reloads before finishing loading. (imported from commit 6b2d80acab4d4232f6eb87695193592a83c4466a) --- zephyr/static/js/reload.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zephyr/static/js/reload.js b/zephyr/static/js/reload.js index c915c8eb51..eb76256302 100644 --- a/zephyr/static/js/reload.js +++ b/zephyr/static/js/reload.js @@ -33,7 +33,10 @@ function preserve_state(send_after_reload) { url += "+msg=" + encodeURIComponent(compose.message_content()); } - url += "+pointer=" + current_msg_list.selected_id(); + var pointer = current_msg_list.selected_id(); + if (pointer !== -1) { + url += "+pointer=" + pointer; + } var oldhash = window.location.hash; if (oldhash.length !== 0 && oldhash[0] === '#') {