diff --git a/web/_js/main/main.js b/web/_js/main/main.js index 3174804f..4a60b860 100644 --- a/web/_js/main/main.js +++ b/web/_js/main/main.js @@ -500,7 +500,9 @@ async function init() { } function updateAtlasAll(atlas = atlasAll) { - for (const entry of atlas) { + for (const index in atlas) { + const entry = atlas[index] + entry._index = index const currentLinks = entry.links entry.links = { website: [], diff --git a/web/_js/main/view.js b/web/_js/main/view.js index 9b209a7b..b4f9e373 100644 --- a/web/_js/main/view.js +++ b/web/_js/main/view.js @@ -370,10 +370,10 @@ function buildObjectsList(filter, sort = defaultSort) { sortFunction = (a, b) => b.name.toLowerCase().localeCompare(a.name.toLowerCase()) break case "newest": - sortFunction = (a, b) => b.id.length - a.id.length || b.id.localeCompare(a.id) + sortFunction = (a, b) => b._index - a._index break case "oldest": - sortFunction = (a, b) => a.id.length - b.id.length || a.id.localeCompare(b.id) + sortFunction = (a, b) => a._index - b._index break case "area": sortFunction = (a, b) => calcPolygonArea(b.path) - calcPolygonArea(a.path)