From d063b993e11e4e1b299fe25d63cb740798ba9143 Mon Sep 17 00:00:00 2001 From: Christoph Marzell Date: Wed, 11 Mar 2026 06:10:58 +0100 Subject: [PATCH] add filter query --- app/views/entries/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/entries/index.html.erb b/app/views/entries/index.html.erb index e37e234..1cbb80a 100644 --- a/app/views/entries/index.html.erb +++ b/app/views/entries/index.html.erb @@ -325,6 +325,7 @@ document.addEventListener('DOMContentLoaded', function () { document.querySelectorAll('.open-delete-modal').forEach(button => { button.addEventListener('click', function (e) { + e.preventDefault(); const targetUrl = this.getAttribute('href'); document.getElementById('modal-delete-form').setAttribute('action', targetUrl); @@ -340,11 +341,10 @@ const filterInput = document.getElementById("entryFilter"); const table = document.getElementById("entriesTable"); const tableRows = table?.querySelectorAll("tbody tr"); - if (filterInput && table && tableRows) { filterInput.addEventListener("keyup", function () { const query = this.value.toLowerCase(); - + console.log(query); tableRows.forEach(row => { const text = row.textContent.toLowerCase(); row.style.display = text.includes(query) ? "" : "none";