Hide zero-value bestiary rows
This commit is contained in:
@@ -188,10 +188,16 @@
|
||||
return value ?? "";
|
||||
}
|
||||
|
||||
function hasAnyBestiaryValue(row) {
|
||||
const keys = ["hp", "atp", "dfp", "mst", "ata", "evp", "lck", "esp", "exp", "efr", "eic", "eth", "elt", "edk"];
|
||||
return keys.some((key) => Number(row[key] || 0) !== 0);
|
||||
}
|
||||
|
||||
function visibleRows() {
|
||||
const search = state.filters.search.trim().toLowerCase();
|
||||
|
||||
return state.rows.filter((row) => {
|
||||
if (!hasAnyBestiaryValue(row)) return false;
|
||||
if (state.filters.mode && row.mode !== state.filters.mode) return false;
|
||||
if (state.filters.episode && row.episode !== state.filters.episode) return false;
|
||||
if (state.filters.difficulty && row.difficulty !== state.filters.difficulty) return false;
|
||||
|
||||
+1
-1
@@ -114,6 +114,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="bestiary-tables.js?v=bp-tier-none-exp-cap-1" defer></script>
|
||||
<script src="bestiary-tables.js?v=hide-zero-bestiary-rows-1" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user