fix sorting in codex on title
This commit is contained in:
parent
d54514079c
commit
aa4381bc32
|
@ -8,10 +8,10 @@ document.addEventListener("DOMContentLoaded",function() {
|
||||||
}
|
}
|
||||||
var sorts = {
|
var sorts = {
|
||||||
"year": (a, b) => toI(a, 'year') > toI(b, 'year'),
|
"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'),
|
"hours": (a, b) =>toI(a, 'hours') > toI(b, 'hours'),
|
||||||
"date": (a, b) => a.querySelector('.date').dateTime.localeCompare(b.querySelector('.date').dateTime),
|
"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])
|
articles.sort(sorts[by])
|
||||||
|
|
Loading…
Reference in New Issue