]> git.mdlowis.com Git - projs/mdl.git/commitdiff
set style.display for all children, so they can be un-hidden
author80B <wtf@idk.lol>
Thu, 7 Jan 2021 22:24:59 +0000 (22:24 +0000)
committer80B <wtf@idk.lol>
Thu, 7 Jan 2021 22:24:59 +0000 (22:24 +0000)
index.html

index e9d713d1db013030e4ba9de7f37d0f14cd4c7174..b31b9c01deab4881a2d4ce972d75868ba7ce669c 100644 (file)
@@ -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 = {