Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
497a51203d | ||
|
|
d32ef508a8 | ||
|
|
a8a9e2ef15 | ||
|
|
264781a815 |
No files matched your search
@@ -5,5 +5,6 @@ Liste der User Stories und ihr Status:
|
||||
## Als ein Nutzer möchte ich
|
||||
|
||||
- ... Gegenstände mit Namen und Menge hinzufügen
|
||||
- ... möchte ich Gegenstände bearbeiten können
|
||||
- ... Kategorien erstellen können und darunter Gegenstände hinzufügen
|
||||
- ... Kategorien samt Inhalt speichern und wiederaufrufen können
|
||||
@@ -0,0 +1,3 @@
|
||||
li:has(input:checked){
|
||||
text-decoration: line-through;
|
||||
}
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
|
||||
<div class="list">
|
||||
<form class="list__inputForm">
|
||||
<input type="text" class="list__inputForm__itemName" name="itemName">
|
||||
<input type="text" class="list__inputForm__itemAmount" name="itemAmount">
|
||||
<input type="text" class="list__inputForm__itemName" name="itemName" placeholder="Gegenstand eingeben...">
|
||||
<input type="text" class="list__inputForm__itemAmount" name="itemAmount" placeholder="Menge eingeben...">
|
||||
<button class="list__inputForm__submitButton" type="submit">Hinzufügen</button>
|
||||
</form>
|
||||
|
||||
|
||||
+12
-1
@@ -20,7 +20,15 @@ function renderList() {
|
||||
listItems.forEach((element, index) => {
|
||||
const li = document.createElement("li");
|
||||
const removeButton = document.createElement("button");
|
||||
const editButton = document.createElement("button");
|
||||
const doneButton = document.createElement("input");
|
||||
|
||||
doneButton.setAttribute("type", "checkbox");
|
||||
doneButton.addEventListener("change", () => {
|
||||
listItems[index].done = doneButton.checked;
|
||||
});
|
||||
|
||||
editButton.textContent = "Bearbeiten"
|
||||
removeButton.textContent = "Löschen";
|
||||
removeButton.addEventListener("click", () => {
|
||||
listItems.splice(index, 1);
|
||||
@@ -28,7 +36,10 @@ function renderList() {
|
||||
});
|
||||
|
||||
li.textContent = element.name + " " + element.amount;
|
||||
li.appendChild(removeButton)
|
||||
li.appendChild(removeButton);
|
||||
li.appendChild(doneButton);
|
||||
li.appendChild(editButton);
|
||||
|
||||
|
||||
itemList.appendChild(li);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user