implementierung editCategoryForm

Form zur bearbeitung einer KAtegorie wird bereitgestellt
This commit is contained in:
Technoir committed 2026-10-09 15:42:51 +02:00
1 parent 6a32200ce5
commit ed2cfe8be9
1 file changed
+21
@@ -41,6 +41,7 @@ export function createEditItemForm(textElement) {
return editForm;
}
export function deleteItem(li) {
li.remove();
}
@@ -70,6 +71,26 @@ export function deleteCategory(deleteAllItems, categoryID) {
}
export function createEditCategoryForm(textElement) {
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", textElement.querySelector(".category__name").textContent);
inputName.classList.add("editForm__name");
abortButton.textContent = "Abbrechen";
saveButton.textContent = "Speichern";
editForm.appendChild(inputName);
editForm.appendChild(saveButton);
editForm.appendChild(abortButton);
return editForm;
}
export function deleteAllDoneItems() {
const doneItems = document.querySelectorAll("li.item:has(input[type=checkbox]:checked)");
doneItems.forEach((li) => {