editList Funktionen entfernt

This commit is contained in:
Technoir committed 2026-10-15 13:20:52 +02:00
1 parent 6c8b61fdda
commit 75cc93f141
1 file changed
-35
@@ -30,38 +30,3 @@ export function deleteList(listElement) {
document.querySelector(`li.navbar__list[data-id='${listElement.dataset.id}']`).remove();
listElement.remove();
}
export function createEditListForm(textElement) {
const editForm = document.createElement("form");
const inputName = document.createElement("input");
const abortButton = document.createElement("button");
const saveButton = document.createElement("button");
inputName.setAttribute("name", "newListName");
inputName.setAttribute("value", textElement.querySelector(".list__name").textContent);
inputName.classList.add("editForm__name");
abortButton.textContent = "Abbrechen";
saveButton.textContent = "Speichern";
saveButton.classList.add("editForm__saveButton");
abortButton.classList.add("editForm__abortButton");
editForm.append(inputName, saveButton, abortButton);
return editForm;
}
export function editList(id, formElement, formData, listLi) {
let newName = formData.newListName;
document.querySelector(`.navbar__list[data-id='${listLi.dataset.id}'] > a`).textContent = newName;
listLi.querySelector(".list__name").textContent = newName;
listLi.setAttribute("href", `/list/${id}`);
formElement.replaceWith(listLi);
}