From 3bc49ec40d63fe3c3709a2f06ba6d6da24045b93 Mon Sep 17 00:00:00 2001 From: retoor Date: Sun, 22 Jun 2025 23:17:56 +0200 Subject: [PATCH] Update tags. --- frontend/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/index.html b/frontend/index.html index e9d044a..c3622b7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -435,7 +435,7 @@ customElements.define('note-compose', NoteCompose); async function loadNotes(tag){ const r=await fetch(tag?`${API_BASE}/notes?tag=${encodeURIComponent(tag)}`:`${API_BASE}/notes`); const ns=r.ok?await r.json():[]; const g=document.getElementById('note-grid'); g.innerHTML=''; ns.forEach(n=>{const c=document.createElement('note-card'); c.data=n; g.appendChild(c);} ); } async function loadTags(){ const r=await fetch(`${API_BASE}/tags`); const ts=r.ok?await r.json():[]; const l=document.getElementById('tag-list'); l.innerHTML=''; ts.forEach(t=>{const li=document.createElement('li'); li.textContent=t.name||t; li.onclick=()=>{document.querySelectorAll('#tag-list li').forEach(x=>x.classList.toggle('active',x===li)); loadNotes(t.name||t);}; l.appendChild(li);} ); } -document.addEventListener('notes-changed', () => loadNotes()); +document.addEventListener('notes-changed', () => { loadNotes(); loadTags(); }); loadNotes(); loadTags();