File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,17 @@ $(".lazy").lazy({
6
6
} ) ;
7
7
$ ( '[data-toggle="tooltip"]' ) . tooltip ( ) ;
8
8
9
- var taxonDomElem = Array . from ( document . querySelectorAll ( "#taxonList li" ) )
10
9
11
10
$ ( document ) . ready ( function ( ) {
11
+
12
+ var taxonDomElems = Array . from ( document . querySelectorAll ( "#taxonList li" ) )
13
+
12
14
function filterListeEspèces ( ) {
13
15
let name = document . querySelector ( "#taxonInput" ) . value . toLowerCase ( ) ;
14
16
let onlyProtégées = document . querySelector ( "#filtreProtégées" ) . checked ;
15
17
let onlyPatrimoniales = document . querySelector ( "#filtrePatrimoniales" ) . checked ;
16
18
17
- const filteredTaxonDomElem = taxonDomElem . filter ( elem => {
19
+ const filteredTaxonDomElems = taxonDomElems . filter ( elem => {
18
20
let matched = elem . innerText . toLowerCase ( ) . indexOf ( name ) > - 1
19
21
&& ( ! onlyProtégées || "data-protégée" in elem . attributes )
20
22
&& ( ! onlyPatrimoniales || "data-patrimoniale" in elem . attributes ) ;
@@ -23,9 +25,9 @@ $(document).ready(function(){
23
25
}
24
26
} )
25
27
document . querySelectorAll ( "#taxonList li" ) . forEach ( e => e . remove ( ) ) ;
26
- document . querySelector ( "#taxonList ul" ) . append ( ...filteredTaxonDomElem )
28
+ document . querySelector ( "#taxonList ul" ) . append ( ...filteredTaxonDomElems )
27
29
}
28
30
document . querySelectorAll ( "#filtresListeEspèces input" ) . forEach (
29
31
( element ) => element . addEventListener ( "input" , filterListeEspèces )
30
32
)
31
- } ) ;
33
+ } ) ;
Original file line number Diff line number Diff line change 36
36
{% if config.DISPLAY_PATRIMONIALITE %}
37
37
< div class ="custom-control custom-switch ">
38
38
< 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 >
40
40
</ div >
41
41
{% endif %}
42
42
</ div >
You can’t perform that action at this time.
0 commit comments