Erstellen eines items erfolgt nach shopping-item
This commit is contained in:
1 parent
3152c92ac0
commit
5e0b6d7477
1 file changed
+9
-2
@@ -7,10 +7,17 @@ export function addItem(itemAsJSON) {
|
||||
} else {
|
||||
list = document.querySelector(`li[data-id='${itemAsJSON.categoryID}']`).querySelector("ul");
|
||||
}
|
||||
const li = document.createElement("li");
|
||||
const item = document.createElement("shopping-item");
|
||||
|
||||
const item = ShoppingItem.fromJSON(itemAsJSON);
|
||||
li.dataset.id = itemAsJSON.itemID;
|
||||
li.classList.add("item");
|
||||
|
||||
list.append(item.render());
|
||||
item.setAttribute("item-name", itemAsJSON.itemName);
|
||||
item.setAttribute("item-amount", itemAsJSON.itemAmount);
|
||||
|
||||
li.append(item);
|
||||
list.append(li);
|
||||
}
|
||||
|
||||
export function createEditItemForm(textElement) {
|
||||
|
||||
Reference in new issue
Block a user