Say "35 trails", not "35 of 35 trails", when nothing is filtered out
The count above each set of rows keeps the "12 of 35 trails" form only when some are filtered out, in the built pages and in the script alike. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
76622257b7
commit
5abd7b1ede
5 files changed
+50
-5
No files matched your search
+10
-3
@@ -1545,7 +1545,13 @@
|
||||
return out;
|
||||
}
|
||||
|
||||
return { passes: passes, count: count };
|
||||
/* The words after the figure of the count above a list: "trails" when every one is shown,
|
||||
"of 35 trails" when some are left out. */
|
||||
function countWords(shown, total, noun) {
|
||||
return (shown === total ? '' : 'of ' + total + ' ') + noun;
|
||||
}
|
||||
|
||||
return { passes: passes, count: count, countWords: countWords };
|
||||
})();
|
||||
/* facet-counts:end */
|
||||
|
||||
@@ -1926,13 +1932,14 @@
|
||||
ol.hidden = !any;
|
||||
if (head && head.classList.contains('results__group')) head.hidden = !any;
|
||||
});
|
||||
var text = shown.length + ' of ' + total + ' ' + noun;
|
||||
var words = FacetCount.countWords(shown.length, total, noun);
|
||||
var text = shown.length + ' ' + words;
|
||||
if (count && count.textContent !== text) {
|
||||
count.innerHTML = '';
|
||||
var strong = document.createElement('strong');
|
||||
strong.textContent = String(shown.length);
|
||||
count.appendChild(strong);
|
||||
count.appendChild(document.createTextNode(' of ' + total + ' ' + noun));
|
||||
count.appendChild(document.createTextNode(' ' + words));
|
||||
}
|
||||
if (empty) empty.hidden = shown.length > 0;
|
||||
if (listHead) listHead.hidden = shown.length === 0;
|
||||
|
||||
Reference in new issue
Block a user