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 <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Gehad elrobey 2014-07-20 16:48:10 +02:00 committed by Dirk Hohndel
parent bbe3440612
commit 03df7b989d

View file

@ -1054,7 +1054,7 @@ function unshowDiveDetails(dive)
function nextDetailedDive()
{
if (dive_id < items.length) {
if (dive_id < items.length - 1) {
showDiveDetails(++dive_id);
}
}