summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'script.js')
-rw-r--r--script.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/script.js b/script.js
index fce62e0..4279561 100644
--- a/script.js
+++ b/script.js
@@ -6,6 +6,12 @@
input.addEventListener('input', (e) => {
const query = e.target.value;
for (const [key, data] of Object.entries(versions)) {
+ const heading = document.getElementById(key);
+
+ if (data.features == undefined) {
+ heading.hidden = query.length != 0;
+ continue;
+ }
const results = Object.values(data.features).filter(
feat => feat.title.toLowerCase().replaceAll('`', '').includes(query.toLowerCase())
);
@@ -19,7 +25,10 @@
li.appendChild(a);
ul.appendChild(li);
}
- document.getElementById(key + '-list').replaceChildren(...ul.children);
+ const list = document.getElementById(key + '-list');
+ list.replaceChildren(...ul.children);
+ list.hidden = results.length == 0;
+ heading.hidden = results.length == 0;
}
});
})();