mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
fda5ff2af2
commit
8bc232b0bd
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue