This commit is contained in:
2026-02-06 16:14:44 +01:00
parent 1ee438d5be
commit b922a1ced0
2 changed files with 134 additions and 4 deletions

View File

@@ -85,9 +85,16 @@ class View {
bindDeleteTodo(handler) {
this.form.addEventListener("click", (e=>{
this.list.addEventListener("click", (e=>{
if (!e.target.classList.contains("fa-trash")) {
return;
} else {
let li = e.target.closest(".todo")
let id = li.dataset.id;
handler(id);
})
let id = li.dataset.
}
bindEditTodo(handler) {
@@ -95,6 +102,14 @@ class View {
}
bindToggleTodo(handler) {
// TODO
}
this.list.addEventListener("change", (e=>{
if (e.target.type !== "checkbox") {
return;
}else {
let li = e.target.closest(".todo")
let id = li.dataset.id;
handler(id);
})
}