ShoppingItem Element Erstellung angepasst

Name und Menge sind jtzt auch als eigene Spans dort wie in list.html
This commit is contained in:
Technoir committed 2026-10-09 15:00:36 +02:00
1 parent 086e16fc82
commit 61c9348c60
1 file changed
+12 -1
@@ -20,6 +20,9 @@ export class ShoppingItem {
const checkboxDone = document.createElement("input");
const span = document.createElement("span");
const spanName = document.createElement("span");
const spanAmount = document.createElement("span");
const deleteItemButton = document.createElement("button");
li.id = this.itemID;
@@ -29,11 +32,19 @@ export class ShoppingItem {
checkboxDone.setAttribute("autocomplete", "off");
checkboxDone.classList.add("item__markAsDone");
span.textContent = this.itemName + " " + this.itemAmount;
span.classList.add("item__text");
spanName.classList.add("item__textName");
spanAmount.classList.add("item__textAmount");
spanName.textContent = this.itemName;
spanAmount.textContent = this.itemAmount;
deleteItemButton.classList.add("item__deleteButton");
deleteItemButton.textContent = "Löschen";
span.appendChild(spanName);
span.appendChild(spanAmount);
li.appendChild(checkboxDone)
li.appendChild(span);
li.appendChild(deleteItemButton);