From aa4381bc321d35d78a811bbbadbf5766a6a3b689 Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Fri, 15 Dec 2023 14:38:16 +0100 Subject: [PATCH] fix sorting in codex on title --- themes/jefklak-creative-portfolio/assets/js/codex.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/jefklak-creative-portfolio/assets/js/codex.js b/themes/jefklak-creative-portfolio/assets/js/codex.js index f225f48..95b76b3 100644 --- a/themes/jefklak-creative-portfolio/assets/js/codex.js +++ b/themes/jefklak-creative-portfolio/assets/js/codex.js @@ -8,10 +8,10 @@ document.addEventListener("DOMContentLoaded",function() { } var sorts = { "year": (a, b) => toI(a, 'year') > toI(b, 'year'), - "name": (a, b) => a.innerHTML.localeCompare(b.innerHTML), + "name": (a, b) => a.querySelector('.name').innerHTML.toLowerCase() > b.querySelector('.name').innerHTML.toLowerCase(), "hours": (a, b) =>toI(a, 'hours') > toI(b, 'hours'), "date": (a, b) => a.querySelector('.date').dateTime.localeCompare(b.querySelector('.date').dateTime), - "rating": (a, b) => toI(a, 'rating') < toI(b, 'rating') + "rating": (a, b) => toI(a, 'rating') > toI(b, 'rating') } articles.sort(sorts[by])