Fix band switch colour bug

This commit is contained in:
Ian Renton
2025-10-08 05:36:02 +01:00
parent d33fd6cd79
commit e7ae76308e

View File

@@ -240,10 +240,10 @@ function generateBandsMultiToggleFilterCard(band_options) {
// CSS doesn't like IDs with decimal points in, so we need to replace that in the same way as when we originally
// queried the options endpoint and set our CSS.
var cssFormattedBandName = o['name'] ? o['name'].replace('.', 'p') : "unknown";
$p.append(`<input type="checkbox" class="btn-check filter-button-bands storeable-checkbox" name="options" id="filter-button-bands-${cssFormattedBandName}" value="${o['name']}" autocomplete="off" onClick="filtersUpdated()" checked><label class="btn btn-outline" id="filter-button-label-bands-${cssFormattedBandName}" for="filter-button-bands-${cssFormattedBandName}">${o['name']}</label> `);
$p.append(`<input type="checkbox" class="btn-check filter-button-band storeable-checkbox" name="options" id="filter-button-band-${cssFormattedBandName}" value="${o['name']}" autocomplete="off" onClick="filtersUpdated()" checked><label class="btn btn-outline" id="filter-button-label-band-${cssFormattedBandName}" for="filter-button-band-${cssFormattedBandName}">${o['name']}</label> `);
});
// Create All/None buttons
$p.append(` <span style="display: inline-block"><button id="filter-button-bands-all" type="button" class="btn btn-outline-secondary" onclick="toggleFilterButtons('bands', true);">All</button>&nbsp;<button id="filter-button-bands-none" type="button" class="btn btn-outline-secondary" onclick="toggleFilterButtons('bands', false);">None</button></span>`);
$p.append(` <span style="display: inline-block"><button id="filter-button-band-all" type="button" class="btn btn-outline-secondary" onclick="toggleFilterButtons('band', true);">All</button>&nbsp;<button id="filter-button-band-none" type="button" class="btn btn-outline-secondary" onclick="toggleFilterButtons('band', false);">None</button></span>`);
// Compile HTML elements to return
$card_body.append($p);
$card.append($card_body);