Text für Wahl ob alle Gegenstände in der Kategorie gelöscht werden soll
This commit is contained in:
1 parent
78abc6fa6b
commit
2f1da222b8
1 file changed
+6
-2
@@ -75,6 +75,7 @@ export class ShoppingCategory {
|
||||
const spanCategoryName = document.createElement("span");
|
||||
const removeCategoryButton = document.createElement("button"); // Entfernen der Kategorie
|
||||
const removeCategoryItemsCheckbox = document.createElement("input"); // alle Gegenstände drunter entfernen oder nicht
|
||||
const removeCategoryItemsText = document.createElement("span");
|
||||
const ul = document.createElement("ul");
|
||||
const items = this.itemsInCategory.filter((item) => !item.remove);
|
||||
|
||||
@@ -86,6 +87,8 @@ export class ShoppingCategory {
|
||||
});
|
||||
|
||||
removeCategoryItemsCheckbox.setAttribute("type", "checkbox");
|
||||
removeCategoryItemsText.textContent = "Alle Gegenstände in dieser Kategorie löschen? :";
|
||||
|
||||
|
||||
removeCategoryButton.textContent = "Löschen";
|
||||
removeCategoryButton.addEventListener("click", () => {
|
||||
@@ -101,8 +104,9 @@ export class ShoppingCategory {
|
||||
});
|
||||
|
||||
ul.appendChild(spanCategoryName);
|
||||
ul.append(removeCategoryButton);
|
||||
ul.append(removeCategoryItemsCheckbox);
|
||||
ul.appendChild(removeCategoryButton);
|
||||
ul.appendChild(removeCategoryItemsText);
|
||||
ul.appendChild(removeCategoryItemsCheckbox);
|
||||
items.forEach((item, index) => {
|
||||
ul.append(item.render());
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user