fix #all
This commit is contained in:
parent
e1718bb861
commit
df0190c950
1 changed files with 6 additions and 3 deletions
|
@ -95,15 +95,18 @@ function makeFragment() {
|
||||||
|
|
||||||
function useFragment() {
|
function useFragment() {
|
||||||
let frag = decodeURIComponent(location.hash).replace(/^#/, '');
|
let frag = decodeURIComponent(location.hash).replace(/^#/, '');
|
||||||
|
let details = document.getElementById('filters-details');
|
||||||
|
|
||||||
if (frag == 'all' || !frag) {
|
if (!frag) {
|
||||||
clearForm();
|
clearForm();
|
||||||
|
} else if (frag == 'all') {
|
||||||
|
allBoxes.forEach(b => b.checked = false);
|
||||||
|
details.open = false;
|
||||||
} else {
|
} else {
|
||||||
let set = new Set(frag.split(';'));
|
let set = new Set(frag.split(';'));
|
||||||
let re = /^(require|exclude)_|hide_filters/;
|
let re = /^(require|exclude)_|hide_filters/;
|
||||||
if (new Array(...set).every(x => re.test(x))) {
|
if (Array.from(set).every(x => re.test(x))) {
|
||||||
allBoxes.forEach(b => b.checked = set.has(b.id));
|
allBoxes.forEach(b => b.checked = set.has(b.id));
|
||||||
let details = document.getElementById('filters-details');
|
|
||||||
details.open = !set.has('hide_filters');
|
details.open = !set.has('hide_filters');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue