From 8bc232b0bd8ce328b91138e8ef2df6cf64dbf2d6 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Tue, 12 Aug 2014 13:30:18 +0300 Subject: HTML: Scroll page to the top before showing the detailed view. When looking at the dive list view, clicking on the 'show more details' retains the view at the current vertical position, meaning that the graph is somewhere above, outside the page view. Page must be scrolled to the top before viewing the detailed dive view. Signed-off-by: Gehad elrobey Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- theme/list_lib.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/theme/list_lib.js b/theme/list_lib.js index 8c365d5a5..ed9bc2c16 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -1166,6 +1166,7 @@ function showDiveDetails(dive) document.getElementById("diveListPanel").style.display = 'none'; document.getElementById("divePanel").style.display = 'block'; canvas_draw(); + scrollToTheTop(); } function setDiveTitle(dive) @@ -1218,6 +1219,11 @@ function switchDives(e) } } +function scrollToTheTop() +{ + window.scrollTo(0, 0); +} + window.onresize = function(event) { if (plot1) -- cgit v1.2.3-70-g09d2