mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 12:55:36 -04:00
feat: basic crud complete
This commit is contained in:
parent
6fb88b315a
commit
77a93ae9b1
10 changed files with 105 additions and 27 deletions
|
@ -4,6 +4,7 @@ import { addForm } from "./components/addForm.js";
|
|||
const newItemLink = document.querySelector("a[href='/add']");
|
||||
const modalElement = await modal();
|
||||
let modalToggle = false;
|
||||
|
||||
async function handleDelete(e) {
|
||||
console.log(e.target);
|
||||
}
|
||||
|
@ -55,7 +56,13 @@ newItemLink.addEventListener("click", (e) => {
|
|||
e.preventDefault();
|
||||
modalToggle
|
||||
? (modalElement.style.display = "none")
|
||||
: (modalElement.style.display = "block");
|
||||
: (modalElement.style.display = "flex");
|
||||
modalToggle = !modalToggle;
|
||||
});
|
||||
|
||||
modalElement.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
if (e.target === e.currentTarget) modalElement.style.display = "none";
|
||||
modalToggle = !modalToggle;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue