From a5f410d587c350f26f9255e115260851551d2a15 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 26 Mar 2015 10:43:09 +0100 Subject: this might stop page scrolls while new updates drop in --- view/js/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index 4a7db0fdb..f6bc22e34 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -666,8 +666,10 @@ function liveUpdate() { else update_mode = 'append'; } - else + else { update_mode = 'update'; + var orgHeight = $("#region_2").height(); + } $.get(update_url, function(data) { page_load = false; @@ -676,6 +678,10 @@ function liveUpdate() { $("#page-spinner").spin(false); $("#profile-jot-text-loading").spin(false); + if(update_mode === 'update') { + $(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight); + } + in_progress = false; // FIXME - the following lines were added so that almost -- cgit v1.2.3