From 0b69384fb7faaefbf041d8c94aea5a08a29f9405 Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Thu, 15 Oct 2026 11:38:49 +0200 Subject: [PATCH] dead code entfernt --- .../js/pages/list/frontend/categoryUI.js | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/src/main/resources/static/js/pages/list/frontend/categoryUI.js b/src/main/resources/static/js/pages/list/frontend/categoryUI.js index 46dd162..b016f74 100644 --- a/src/main/resources/static/js/pages/list/frontend/categoryUI.js +++ b/src/main/resources/static/js/pages/list/frontend/categoryUI.js @@ -1,5 +1,3 @@ - - export function addCategory(categoryAsJSON) { const list = document.querySelector(".displayedList"); const category = document.createElement("shopping-category"); @@ -29,36 +27,4 @@ export function deleteCategory(deleteAllItems, categoryID) { } category.remove() document.querySelector(`option[value='${categoryID}']`).remove(); - -} - -export function createEditCategoryForm(categoryName) { - const editForm = document.createElement("form"); - const inputName = document.createElement("input"); - const abortButton = document.createElement("button"); - const saveButton = document.createElement("button"); - - inputName.setAttribute("name", "newCategoryName"); - inputName.setAttribute("value", categoryName); - inputName.classList.add("editForm__name"); - - abortButton.setAttribute("type", "button"); - abortButton.classList.add("editForm__buttonAbort"); - abortButton.textContent = "Abbrechen"; - saveButton.textContent = "Speichern"; - - editForm.append(inputName, saveButton, abortButton); - - return editForm; -} - -export function editCategory(id, formElement, formData, categoryDiv) { - - let newName = formData.newCategoryName; - - categoryDiv.querySelector(".category__name").textContent = newName; - formElement.replaceWith(categoryDiv); - - document.querySelector(`option[value='${id}']`).textContent = newName; - }