add shortcut for certain filters
This commit is contained in:
parent
d93e38b618
commit
f2aeb8e187
1 changed files with 11 additions and 3 deletions
|
@ -116,11 +116,19 @@ function useFragment() {
|
||||||
allBoxes.forEach(b => b.checked = false);
|
allBoxes.forEach(b => b.checked = false);
|
||||||
details.open = false;
|
details.open = false;
|
||||||
} else {
|
} else {
|
||||||
const set = new Set(frag.split(';'));
|
const pieces =
|
||||||
|
frag == 'summary' ? ['require_artsummary', 'hide_filters'] :
|
||||||
|
frag == 'colourexamples' ? ['require_colourexample', 'hide_filters'] :
|
||||||
|
frag == 'flatexamples' ? ['require_flatexample', 'hide_filters'] :
|
||||||
|
frag == 'sketchexamples' ? ['require_sketchexample', 'hide_filters'] :
|
||||||
|
frag == 'iconexamples' ? ['require_iconexample', 'hide_filters'] :
|
||||||
|
frag == 'curated' ? ['require_curated', 'hide_filters'] :
|
||||||
|
frag.split(';');
|
||||||
|
const set = new Set(pieces);
|
||||||
const re = /^(require|exclude)_|hide_filters/;
|
const re = /^(require|exclude)_|hide_filters/;
|
||||||
if (Array.from(set).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 = !frag.match(/hide_filters|example\b/);
|
// details.open = !set.has('hide_filters');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue