From 8603a7d826a7bcf10dea0f93d564a609aae0050a Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 13 Aug 2018 10:28:14 -0500 Subject: [PATCH] Reverse html trip list rendering order In the HTML export, the list of trips emitted into lib.js is in chronological order, the dives are shown reverse chronological order. This leads to a weird experience of the earliest trip being on top and the dives within it having the most recent dive on top. Invert the processing order in the javascript layer so that the last trip is rendered first. Signed-off-by: Monty Taylor 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 34e4a6043..409229a91 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -772,7 +772,7 @@ function showtrips() { var divelist = document.getElementById('diveslist'); divelist.innerHTML = ""; - for (var i = 0; i < trips.length; i++) { + for (var i = trips.length - 1; i >= 0; i--) { divelist.innerHTML += '
    ' + trips[i].name + ' ( ' + trips[i].dives.length + ' dives)' + '
' + '
'; };