Skip to content

Commit

Permalink
Merge pull request #80 from software-students-spring2024/fix-add
Browse files Browse the repository at this point in the history
Fix add
  • Loading branch information
shriyakalakata authored Mar 3, 2024
2 parents d436e1d + e88685f commit e057318
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions templates/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,21 @@ <h3 id="next-question"> START </h3>
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 = ""
})
}

Expand Down

0 comments on commit e057318

Please sign in to comment.