diff options
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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; } }); })(); |