From 7de35a098fb1a7faa131581f0e65fcde48472594 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Tue, 4 Aug 2020 21:10:50 +0200 Subject: [PATCH] use hidden attr instead of display:none --- script/gallery.js | 6 +----- style/shiny/gallery.css | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/script/gallery.js b/script/gallery.js index d0c45ae..98d82f9 100644 --- a/script/gallery.js +++ b/script/gallery.js @@ -23,11 +23,7 @@ function updateItems() { let req = tags.get(item).some(x => reqTags.has(x)); let exc = tags.get(item).some(x => excTags.has(x)); - if ((req || !anyReq) && !exc) { - item.classList.remove('hidden'); - } else { - item.classList.add('hidden'); - } + item.hidden = exc || (anyReq && !req); } } diff --git a/style/shiny/gallery.css b/style/shiny/gallery.css index 00ba342..4bb8dd8 100644 --- a/style/shiny/gallery.css +++ b/style/shiny/gallery.css @@ -107,10 +107,6 @@ body { background: hsl(340, 45%, 65%); } -.item.hidden { - display: none; -} - .item:focus-within { box-shadow: var(--focus-box); }