Skip to content

Commit

Permalink
Closes #2040 Sorts By Sciname within family
Browse files Browse the repository at this point in the history
# Issue #2040

# Summary
Adds extra sort conditions so that records are sorted by sciname after
being storted by family.
  • Loading branch information
MuchQuak committed Jan 10, 2025
1 parent 82780bf commit 0b8a02a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion collections/map/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,15 @@ function buildTaxaLegend() {
}

let taxaArr = Object.values(taxaLegendMap).sort((a, b) => {
if(a.family === b.family) return 0;
if(a.family === b.family) {
if(a.sn === b.sn) {
return 0;
} else if(a.sn> b.sn) {
return 1;
} else {
return -1;
}
}
else if(a.family > b.family) return 1;
else return -1;
})
Expand Down

0 comments on commit 0b8a02a

Please sign in to comment.