Merge branch 'maintainance/18-appendChild', fixes #18

This commit is contained in:
Technoir committed 2026-10-12 14:14:59 +02:00
commit 75ae18a6ca
4 files changed
+8 -18

No files matched your search

@@ -42,12 +42,9 @@ export class ShoppingItem {
deleteItemButton.classList.add("item__deleteButton");
deleteItemButton.textContent = "Löschen";
span.appendChild(spanName);
span.appendChild(spanAmount);
span.append(spanName, spanAmount);
li.appendChild(checkboxDone)
li.appendChild(span);
li.appendChild(deleteItemButton);
li.append(checkboxDone, span, deleteItemButton);
return li;
}
@@ -32,9 +32,7 @@ export function createEditListForm(textElement) {
saveButton.classList.add("editForm__saveButton");
abortButton.classList.add("editForm__abortButton");
editForm.appendChild(inputName);
editForm.appendChild(saveButton);
editForm.appendChild(abortButton);
editForm.append(inputName, saveButton, abortButton);
return editForm;
}
@@ -5,14 +5,14 @@ export function addCategory(categoryAsJSON) {
const list = document.querySelector(".displayedList");
const category = ShoppingCategory.fromJSON(categoryAsJSON);
list.appendChild(category.render()); //fügt Kategorie der Liste hinzu
list.append(category.render()); //fügt Kategorie der Liste hinzu
const categorySelect = document.querySelector(".addItemForm__categorySelect");
const newCategoryOption = document.createElement("option");
newCategoryOption.setAttribute("value", category.categoryID);
newCategoryOption.textContent = category.categoryName;
categorySelect.appendChild(newCategoryOption);
categorySelect.append(newCategoryOption);
}
export function deleteCategory(deleteAllItems, categoryID) {
@@ -39,9 +39,7 @@ export function createEditCategoryForm(textElement) {
abortButton.textContent = "Abbrechen";
saveButton.textContent = "Speichern";
editForm.appendChild(inputName);
editForm.appendChild(saveButton);
editForm.appendChild(abortButton);
editForm.append(inputName, saveButton, abortButton);
return editForm;
}
@@ -10,7 +10,7 @@ export function addItem(itemAsJSON) {
const item = ShoppingItem.fromJSON(itemAsJSON);
list.appendChild(item.render());
list.append(item.render());
}
export function createEditItemForm(textElement) {
@@ -33,10 +33,7 @@ export function createEditItemForm(textElement) {
saveButton.textContent = "Speichern";
editForm.appendChild(inputName);
editForm.appendChild(inputAmount);
editForm.appendChild(saveButton);
editForm.appendChild(abortButton);
editForm.append(inputName, inputAmount, saveButton, abortButton);
return editForm;
}