style & layout updates
This commit is contained in:
parent
ebd08fb2e5
commit
485b90fb46
9 changed files with 65 additions and 159 deletions
|
@ -130,7 +130,7 @@ function sortFilters(cmp) {
|
|||
sort1('exclude');
|
||||
}
|
||||
|
||||
function sortFiltersAlpha() {
|
||||
function sortFiltersAlpha(e) {
|
||||
function getName(x) {
|
||||
if (x.nodeType == Node.ELEMENT_NODE) {
|
||||
return x.getElementsByTagName('input')[0].value;
|
||||
|
@ -139,9 +139,10 @@ function sortFiltersAlpha() {
|
|||
}
|
||||
}
|
||||
sortFilters((a, b) => getName(a).localeCompare(getName(b)));
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
function sortFiltersUses() {
|
||||
function sortFiltersUses(e) {
|
||||
function getUses(x) {
|
||||
if (x.nodeType == Node.ELEMENT_NODE) {
|
||||
return parseInt(x.getElementsByTagName('label')[0].dataset.count);
|
||||
|
@ -150,6 +151,7 @@ function sortFiltersUses() {
|
|||
}
|
||||
}
|
||||
sortFilters((a, b) => getUses(b) - getUses(a));
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,8 +162,8 @@ function setup() {
|
|||
}
|
||||
|
||||
let items = Array.from(document.getElementsByClassName('post'));
|
||||
itemsByYear = new Map;
|
||||
|
||||
itemsByYear = new Map;
|
||||
for (let item of items) {
|
||||
let year = item.dataset.year;
|
||||
if (!itemsByYear.has(year)) itemsByYear.set(year, new Set);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue