refactoring
This commit is contained in:
1 parent
5f3a6c56f9
commit
882bc0e577
1 file changed
+3
-4
+3
-4
@@ -7,8 +7,8 @@ const itemListElement = document.querySelector(".list__displayedList");
|
||||
|
||||
let listElements = []; // Liste der erstellten Items und Kategorien
|
||||
|
||||
function addCategory() {
|
||||
listCategories.push(new ShoppingCategory(categoryName));
|
||||
function addNewCategory(categoryName) {
|
||||
listElements.push(new ShoppingCategory(categoryName));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ function addNewItem(itemName, itemAmount, category) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function renderList() {
|
||||
function renderItemList() {
|
||||
listElements = listElements.filter(item => !item.remove)
|
||||
itemListElement.innerHTML = ""; //reset innerItemList
|
||||
|
||||
|
||||
Reference in new issue
Block a user