|
|
@ -325,6 +325,7 @@ |
|
|
document.addEventListener('DOMContentLoaded', function () { |
|
|
document.addEventListener('DOMContentLoaded', function () { |
|
|
document.querySelectorAll('.open-delete-modal').forEach(button => { |
|
|
document.querySelectorAll('.open-delete-modal').forEach(button => { |
|
|
button.addEventListener('click', function (e) { |
|
|
button.addEventListener('click', function (e) { |
|
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
e.preventDefault(); |
|
|
const targetUrl = this.getAttribute('href'); |
|
|
const targetUrl = this.getAttribute('href'); |
|
|
document.getElementById('modal-delete-form').setAttribute('action', targetUrl); |
|
|
document.getElementById('modal-delete-form').setAttribute('action', targetUrl); |
|
|
@ -340,11 +341,10 @@ |
|
|
const filterInput = document.getElementById("entryFilter"); |
|
|
const filterInput = document.getElementById("entryFilter"); |
|
|
const table = document.getElementById("entriesTable"); |
|
|
const table = document.getElementById("entriesTable"); |
|
|
const tableRows = table?.querySelectorAll("tbody tr"); |
|
|
const tableRows = table?.querySelectorAll("tbody tr"); |
|
|
|
|
|
|
|
|
if (filterInput && table && tableRows) { |
|
|
if (filterInput && table && tableRows) { |
|
|
filterInput.addEventListener("keyup", function () { |
|
|
filterInput.addEventListener("keyup", function () { |
|
|
const query = this.value.toLowerCase(); |
|
|
const query = this.value.toLowerCase(); |
|
|
|
|
|
|
|
|
|
|
|
console.log(query); |
|
|
tableRows.forEach(row => { |
|
|
tableRows.forEach(row => { |
|
|
const text = row.textContent.toLowerCase(); |
|
|
const text = row.textContent.toLowerCase(); |
|
|
row.style.display = text.includes(query) ? "" : "none"; |
|
|
row.style.display = text.includes(query) ? "" : "none"; |
|
|
|