ajout
This commit is contained in:
@@ -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);
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user