summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2014-08-12 13:30:18 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-14 09:52:54 -0600
commit8bc232b0bd8ce328b91138e8ef2df6cf64dbf2d6 (patch)
treed1aa1f90fdd7d08f616a3d4f2465f7ff9eb8bc57 /theme
parentfda5ff2af23f5cbfa923041be774834c48e50bc2 (diff)
downloadsubsurface-8bc232b0bd8ce328b91138e8ef2df6cf64dbf2d6.tar.gz
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 <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'theme')
-rw-r--r--theme/list_lib.js6
1 files changed, 6 insertions, 0 deletions
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)