Better support for long titles

This commit is contained in:
CasVT
2023-01-16 21:40:11 +01:00
parent 4350687ecc
commit 4e2546027b
2 changed files with 7 additions and 3 deletions

View File

@@ -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));
}

View File

@@ -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());