mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 04:45:36 -04:00
call it done
This commit is contained in:
parent
77a93ae9b1
commit
0647b4af89
6 changed files with 140 additions and 23 deletions
|
@ -66,5 +66,19 @@ modalElement.addEventListener("click", (e) => {
|
|||
modalToggle = !modalToggle;
|
||||
});
|
||||
|
||||
const itemTitles = document.querySelectorAll("p.title");
|
||||
const editItemBtn = document.querySelectorAll(".edit-btn");
|
||||
editItemBtn.forEach((btn) => {
|
||||
btn.addEventListener("click", (e) => {
|
||||
const parent = e.target.parentElement;
|
||||
const itemId = e.target.nextElementSibling.dataset.id;
|
||||
const p = e.target.previousElementSibling;
|
||||
// temp hide
|
||||
p.remove();
|
||||
const input = document.createElement("input");
|
||||
parent.insertBefore(input, e.target);
|
||||
});
|
||||
});
|
||||
|
||||
document.body.append(modalElement);
|
||||
addForm();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue