From aed105d1bccfea845ba3cd56994c0c2d5f2417b6 Mon Sep 17 00:00:00 2001 From: al6862 Date: Sun, 3 Mar 2024 12:35:21 -0500 Subject: [PATCH 1/2] removes text content if close out of form --- templates/card.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/card.html b/templates/card.html index 446789c..2c03865 100644 --- a/templates/card.html +++ b/templates/card.html @@ -151,6 +151,8 @@

START

document.querySelector("#edit-card-button").style.display="initial" document.querySelector("#delete-card-button").style.display="initial" document.querySelector("#card-form").style.display="none" + document.querySelector("#card-form textarea").textContent = "" + document.querySelector("#card-form input").value = "" }) } From e88685ffaa9ffca6045b4608329a7ad3480c8722 Mon Sep 17 00:00:00 2001 From: al6862 Date: Sun, 3 Mar 2024 12:41:20 -0500 Subject: [PATCH 2/2] doesnt display edit or delete option if close out of first START card --- templates/card.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/templates/card.html b/templates/card.html index 2c03865..7967d19 100644 --- a/templates/card.html +++ b/templates/card.html @@ -146,10 +146,18 @@

START

const closeIcon = document.querySelector("#close-icon") if (closeIcon) { closeIcon.addEventListener("click", function() { - document.querySelector("#next-question").style.display="initial" - document.querySelector("#add-card-button").style.display="initial" - document.querySelector("#edit-card-button").style.display="initial" - document.querySelector("#delete-card-button").style.display="initial" + if (cardIndex == -1){ + document.querySelector("#next-question").style.display="initial" + document.querySelector("#add-card-button").style.display="initial" + document.querySelector("#edit-card-button").style.display="none" + document.querySelector("#delete-card-button").style.display="none" + } + else { + document.querySelector("#next-question").style.display="initial" + document.querySelector("#add-card-button").style.display="initial" + document.querySelector("#edit-card-button").style.display="initial" + document.querySelector("#delete-card-button").style.display="initial" + } document.querySelector("#card-form").style.display="none" document.querySelector("#card-form textarea").textContent = "" document.querySelector("#card-form input").value = ""