From 03df7b989d6d94ca47c7cbdfe90f2702e176f897 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Sun, 20 Jul 2014 16:48:10 +0200 Subject: [PATCH] HTML: fix moving to previous dive by keyboard arrows. If I go to next dive on detailed view, and hit one extra right arrows after reaching the last dive, first click on left does not change the selection, only re-clicking on left does. Fix the number of dives to prevent throwing exceptions and fix moving between dives smoothly. Signed-off-by: Gehad elrobey Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- theme/list_lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/list_lib.js b/theme/list_lib.js index 2b5931dab..7204746b8 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -1054,7 +1054,7 @@ function unshowDiveDetails(dive) function nextDetailedDive() { - if (dive_id < items.length) { + if (dive_id < items.length - 1) { showDiveDetails(++dive_id); } }