From 837f5cf38dd1519249b2439397430b8bc1b06dd8 Mon Sep 17 00:00:00 2001 From: 80B Date: Thu, 7 Jan 2021 22:24:59 +0000 Subject: [PATCH] set style.display for all children, so they can be un-hidden --- index.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index e9d713d..b31b9c0 100644 --- a/index.html +++ b/index.html @@ -33,12 +33,9 @@ const loadPage = file => { const filterPages = (allitems) => { const value = search.value.toLowerCase(); - [...pages.children].forEach(child => { - if (child.style.display !== "none" || allitems) { - child.style.display = - child.innerText.toLowerCase().includes(value) ? "list-item" : "none"; - } - } + [...pages.children].forEach(child => ( child.style.display = + allitems || child.innerText.toLowerCase().includes(value) ? 'list-item' + : 'none' )); }; const keys = { -- 2.54.0