From d568f96d053dad4ded8a5e8baf8c361e4b04fd12 Mon Sep 17 00:00:00 2001 From: Gehad Elrobey Date: Mon, 30 Jun 2014 17:13:53 +0200 Subject: HTML: use Right/Left arrows to switch between dives Use arrows to switch between dives in dive detailed view. Signed-off-by: Gehad elrobey Signed-off-by: Dirk Hohndel --- theme/dive_export.html | 2 ++ theme/list_lib.js | 13 +++++++++++++ 2 files changed, 15 insertions(+) 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(); + } + } +} -- cgit v1.2.3-70-g09d2