Bearbeiten des Items durch drücken auf Text
This commit is contained in:
1 parent
1750f8059b
commit
4a032000ae
1 file changed
+1
-4
@@ -72,7 +72,6 @@ export class ShoppingListItem {
|
||||
const li = document.createElement("li");
|
||||
const listContent = document.createElement("span");
|
||||
const removeButton = document.createElement("button");
|
||||
const editButton = document.createElement("button");
|
||||
const doneButton = document.createElement("input");
|
||||
|
||||
doneButton.setAttribute("type", "checkbox");
|
||||
@@ -80,8 +79,7 @@ export class ShoppingListItem {
|
||||
this.isDone = doneButton.checked;
|
||||
});
|
||||
|
||||
editButton.textContent = "Bearbeiten"
|
||||
editButton.addEventListener("click", () => {
|
||||
listContent.addEventListener("click", () => {
|
||||
this.isEditing = true;
|
||||
this.onChange();
|
||||
});
|
||||
@@ -96,7 +94,6 @@ export class ShoppingListItem {
|
||||
|
||||
li.appendChild(doneButton);
|
||||
li.appendChild(listContent);
|
||||
li.appendChild(editButton);
|
||||
li.appendChild(removeButton);
|
||||
|
||||
return li;
|
||||
|
||||
Reference in new issue
Block a user