]> git.mdlowis.com Git - projs/mdl.git/commitdiff
+.css method to Ls & .hidden class
author80B <wtf@idk.lol>
Thu, 7 Jan 2021 22:30:58 +0000 (22:30 +0000)
committer80B <wtf@idk.lol>
Thu, 7 Jan 2021 22:30:58 +0000 (22:30 +0000)
index.html
style.css

index f5cf995048fea03d7b517ce331f97517d8187e8b..c9e092c1ea4a04a7ded0ae9e6772b074e6d8fd86 100644 (file)
@@ -28,13 +28,14 @@ const loadPage = file => {
     const L = (tag, props = {}, ...kids) => {
         const el = document.createElement(tag);
         el.append(...kids);
-        return Object.assign(el, props);
+        return Object.assign( el,
+            { css: (k, v) => el.classList[v ? 'add' : 'remove'](k) },
+            props );
     };
 
     const filterPages = (allitems, value = search.value.toLowerCase()) =>
-        [...pages.children].forEach(child => ( child.style.display =
-            allitems || child.innerText.toLowerCase().includes(value) ? 'list-item'
-            : 'none' ));
+        [...pages.children].forEach( child => child.css('hidden',
+            !allitems && !child.innerText.toLowerCase().includes(value) ));
 
     const keys = {
         "f": () => {
index 612af124faeb7ba8fb2c6732dd7cdf1681bd9996..a8e312048f2e4329acc5a0264fa0d0cb2d865059 100644 (file)
--- a/style.css
+++ b/style.css
@@ -119,3 +119,5 @@ aside section {
                 0 3px 1px -2px rgba(0,0,0,0.20),
                 0 1px 5px  0px rgba(0,0,0,0.12);
 }
+
+.hidden { display: none !important; }