diff options
author | Gehad Elrobey <gehadelrobey@gmail.com> | 2014-06-30 17:13:53 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-01 19:41:11 -0700 |
commit | d568f96d053dad4ded8a5e8baf8c361e4b04fd12 (patch) | |
tree | bc9b895a4a3c5bdc6d7663a0f0afe2f144753c5c /theme | |
parent | 3c7bb789afd69bb0163f6d3002ac7ea2ee529817 (diff) | |
download | subsurface-d568f96d053dad4ded8a5e8baf8c361e4b04fd12.tar.gz |
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>
Diffstat (limited to 'theme')
-rw-r--r-- | theme/dive_export.html | 2 | ||||
-rw-r--r-- | theme/list_lib.js | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/theme/dive_export.html b/theme/dive_export.html index 91c47dbe9..e1d89f48c 100644 --- a/theme/dive_export.html +++ b/theme/dive_export.html @@ -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){ diff --git a/theme/list_lib.js b/theme/list_lib.js index 0d84516d2..4347475c6 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -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(); + } + } +} |