filters always collapsed on page load

This commit is contained in:
rhiannon morris 2024-07-07 22:05:59 +02:00
parent f2aeb8e187
commit ab0e1a4127

View file

@ -117,18 +117,16 @@ function useFragment() {
details.open = false; details.open = false;
} else { } else {
const pieces = const pieces =
frag == 'summary' ? ['require_artsummary', 'hide_filters'] : frag == 'summary' ? ['require_artsummary'] :
frag == 'colourexamples' ? ['require_colourexample', 'hide_filters'] : frag == 'colourexamples' ? ['require_colourexample'] :
frag == 'flatexamples' ? ['require_flatexample', 'hide_filters'] : frag == 'flatexamples' ? ['require_flatexample'] :
frag == 'sketchexamples' ? ['require_sketchexample', 'hide_filters'] : frag == 'sketchexamples' ? ['require_sketchexample'] :
frag == 'iconexamples' ? ['require_iconexample', 'hide_filters'] : frag == 'iconexamples' ? ['require_iconexample'] :
frag == 'curated' ? ['require_curated', 'hide_filters'] : frag == 'curated' ? ['require_curated'] : frag.split(';');
frag.split(';');
const set = new Set(pieces); const set = new Set(pieces);
const re = /^(require|exclude)_|hide_filters/; const re = /^(require|exclude)_|hide_filters/;
if (pieces.every(x => re.test(x))) { if (pieces.every(x => re.test(x))) {
allBoxes.forEach(b => b.checked = set.has(b.id)); allBoxes.forEach(b => b.checked = set.has(b.id));
// details.open = !set.has('hide_filters');
} }
} }