kalender und fixes
This commit is contained in:
1 parent
940d9bbde4
commit
416ca9e854
14 files changed
+376
-71
No files matched your search
@@ -104,13 +104,25 @@ export function formatTodoItems(container) {
|
||||
const cb = li.querySelector('input[type="checkbox"]');
|
||||
if (!cb) return;
|
||||
if (li.classList.contains('todo-item')) return;
|
||||
|
||||
const checked = cb.checked;
|
||||
li.classList.add('todo-item');
|
||||
if (cb.checked) li.classList.add('todo-done');
|
||||
// Wrap remaining text nodes in a span
|
||||
if (checked) li.classList.add('todo-done');
|
||||
|
||||
// Replace <input> with a styled button
|
||||
const btn = document.createElement('button');
|
||||
btn.type = 'button';
|
||||
btn.className = 'todo-cb' + (checked ? ' checked' : '');
|
||||
btn.innerHTML = '<i class="ph ph-check"></i>';
|
||||
btn.dataset.idx = cb.dataset.idx || '';
|
||||
cb.replaceWith(btn);
|
||||
|
||||
// Wrap remaining content in a span
|
||||
const span = document.createElement('span');
|
||||
span.className = 'todo-text';
|
||||
while (cb.nextSibling) span.appendChild(cb.nextSibling);
|
||||
while (btn.nextSibling) span.appendChild(btn.nextSibling);
|
||||
li.appendChild(span);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user