Skip to content

Commit 296a8da

Browse files
committed
fix taxon filter list
1 parent be4d904 commit 296a8da

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

atlas/static/listeEspeces.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ $(".lazy").lazy({
66
});
77
$('[data-toggle="tooltip"]').tooltip();
88

9-
var taxonDomElem = Array.from(document.querySelectorAll("#taxonList li"))
109

1110
$(document).ready(function(){
11+
12+
var taxonDomElems = Array.from(document.querySelectorAll("#taxonList li"))
13+
1214
function filterListeEspèces() {
1315
let name = document.querySelector("#taxonInput").value.toLowerCase();
1416
let onlyProtégées = document.querySelector("#filtreProtégées").checked;
1517
let onlyPatrimoniales = document.querySelector("#filtrePatrimoniales").checked;
1618

17-
const filteredTaxonDomElem = taxonDomElem.filter(elem => {
19+
const filteredTaxonDomElems = taxonDomElems.filter(elem => {
1820
let matched = elem.innerText.toLowerCase().indexOf(name) > -1
1921
&& (!onlyProtégées || "data-protégée" in elem.attributes)
2022
&& (!onlyPatrimoniales || "data-patrimoniale" in elem.attributes);
@@ -23,9 +25,9 @@ $(document).ready(function(){
2325
}
2426
})
2527
document.querySelectorAll("#taxonList li").forEach(e => e.remove());
26-
document.querySelector("#taxonList ul").append(...filteredTaxonDomElem)
28+
document.querySelector("#taxonList ul").append(...filteredTaxonDomElems)
2729
}
2830
document.querySelectorAll("#filtresListeEspèces input").forEach(
2931
(element) => element.addEventListener("input", filterListeEspèces)
3032
)
31-
});
33+
});

atlas/templates/core/listTaxons.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{% if config.DISPLAY_PATRIMONIALITE %}
3737
<div class="custom-control custom-switch">
3838
<input id="filtrePatrimoniales" name="filtrePatrimoniales" type="checkbox" class="custom-control-input" />
39-
<label for="filtrePatrimoniales" class="custom-control-label">{{ _("espèces.%(label_patrimonialite)s.uniquement", label_patrimonialite=config.PATRIMONIALITE.label_pluriel)|lower }}</label>
39+
<label for="filtrePatrimoniales" class="custom-control-label">{{ _("espèces.%(label_patrimonialite)s.uniquement", label_patrimonialite=config.PATRIMONIALITE.label_pluriel)|lower|capitalize }}</label>
4040
</div>
4141
{% endif %}
4242
</div>

0 commit comments

Comments
 (0)