always open filters when popping state
This commit is contained in:
parent
a212487613
commit
069a65ab71
1 changed files with 4 additions and 4 deletions
|
@ -80,7 +80,7 @@ function makeFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
function useFragment(firstLoad) {
|
||||
function useFragment() {
|
||||
let frag = location.hash.replace(/^#/, '');
|
||||
|
||||
if (frag == 'all') {
|
||||
|
@ -88,7 +88,7 @@ function useFragment(firstLoad) {
|
|||
} else if (frag) {
|
||||
let set = new Set(frag.split(';'));
|
||||
allBoxes.forEach(b => b.checked = set.has(b.id));
|
||||
if (firstLoad) document.getElementById('filters-details').open = true;
|
||||
document.getElementById('filters-details').open = true;
|
||||
} else {
|
||||
resetForm();
|
||||
}
|
||||
|
@ -112,9 +112,9 @@ function setup() {
|
|||
document.getElementById('clear').addEventListener('click', clear);
|
||||
document.getElementById('reset').addEventListener('click', reset);
|
||||
|
||||
window.addEventListener('popstate', () => useFragment(false));
|
||||
window.addEventListener('popstate', useFragment);
|
||||
|
||||
useFragment(true);
|
||||
useFragment();
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', setup);
|
||||
|
|
Loading…
Reference in a new issue