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:
Gehad Elrobey 2014-06-30 17:13:53 +02:00 committed by Dirk Hohndel
parent 3c7bb789af
commit d568f96d05
2 changed files with 15 additions and 0 deletions

View file

@ -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){

View file

@ -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();
}
}
}