From df0190c950f6db91a7f6ce8bbbeedbb58423c48d Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Wed, 5 Jan 2022 16:10:19 +0100 Subject: [PATCH] fix #all --- script/gallery.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/script/gallery.js b/script/gallery.js index 09510c2..afa1c01 100644 --- a/script/gallery.js +++ b/script/gallery.js @@ -95,15 +95,18 @@ function makeFragment() { function useFragment() { let frag = decodeURIComponent(location.hash).replace(/^#/, ''); + let details = document.getElementById('filters-details'); - if (frag == 'all' || !frag) { + if (!frag) { clearForm(); + } else if (frag == 'all') { + allBoxes.forEach(b => b.checked = false); + details.open = false; } else { let set = new Set(frag.split(';')); 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)); - let details = document.getElementById('filters-details'); details.open = !set.has('hide_filters'); } }