diff --git a/frontend/static/css/reminders.css b/frontend/static/css/reminders.css index 3448113..4915b49 100644 --- a/frontend/static/css/reminders.css +++ b/frontend/static/css/reminders.css @@ -95,6 +95,10 @@ background-color: var(--color-gray); } +div.entry.fit { + flex-grow: 1; +} + .entry.expand { width: calc(var(--entry-width) * 2 + var(--gap)); } diff --git a/frontend/static/js/reminders.js b/frontend/static/js/reminders.js index dc875ff..8d8e0a9 100644 --- a/frontend/static/js/reminders.js +++ b/frontend/static/js/reminders.js @@ -1,6 +1,6 @@ function fillTable(result) { const table = document.getElementById('reminder-list'); - table.querySelectorAll('div:not(#add-entry)').forEach(e => e.remove()); + table.querySelectorAll('div.entry').forEach(e => e.remove()); result.forEach(reminder => { const entry = document.createElement('div'); @@ -37,11 +37,11 @@ function fillTable(result) { table.appendChild(entry); - // Increase size if title is overflowing if (title.clientHeight < title.scrollHeight) { entry.classList.add('expand'); }; }); + table.querySelectorAll('div.entry').forEach(reminder => reminder.classList.add('fit')); }; function fillList() { @@ -119,7 +119,7 @@ function deleteReminder(id) { // code run on load fillList(); -setInterval(fillList, 60000); +// setInterval(fillList, 60000); document.getElementById('search-form').setAttribute('action', 'javascript:search();'); document.getElementById('clear-button').addEventListener('click', e => clearSearch());