mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:33:23 +00:00
HTML: use Right/Left arrows to switch between dives
Use arrows to switch between dives in dive detailed view. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3c7bb789af
commit
d568f96d05
2 changed files with 15 additions and 0 deletions
|
@ -111,6 +111,8 @@ window.onload=function(){
|
|||
showAllDives();
|
||||
document.getElementById("divePanel").style.display='none';
|
||||
document.body.style.visibility='visible';
|
||||
|
||||
document.onkeydown = switchDives;
|
||||
}
|
||||
|
||||
function changeAdvSearch(e){
|
||||
|
|
|
@ -1026,3 +1026,16 @@ function prevDetailedDive()
|
|||
showDiveDetails(--dive_id);
|
||||
}
|
||||
}
|
||||
|
||||
function switchDives(e)
|
||||
{
|
||||
if(document.getElementById("divePanel").style.display == 'block'){
|
||||
e = e || window.event;
|
||||
if (e.keyCode == '37') {
|
||||
prevDetailedDive();
|
||||
}
|
||||
else if (e.keyCode == '39') {
|
||||
nextDetailedDive();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue