diff --git a/script/gallery.js b/script/gallery.js index 72cf12e..8399a75 100644 --- a/script/gallery.js +++ b/script/gallery.js @@ -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);