Skip to content

Commit

Permalink
delete post confirm() #83
Browse files Browse the repository at this point in the history
  • Loading branch information
rystaf committed Oct 4, 2023
1 parent aaf0234 commit 0f48251
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion public/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function commentClick(e) {
} else { return }
e.target.disabled = "disabled"
if (data.get("op") == "delete_comment") {
if (!confirm("Are you sure you want to delete?")) {
if (!confirm("Are you sure?")) {
return false
}
}
Expand Down Expand Up @@ -242,6 +242,11 @@ function formSubmit(e) {
targ.remove()
return
}
if (data.get("op") == "delete_post") {
if (!confirm("Are you sure?")) {
return false
}
}
e.submitter.disabled = "disabled"
request(targ.target, data,
function(res){
Expand All @@ -267,6 +272,10 @@ function formSubmit(e) {
targ.remove()
return
}
if (data.get("op") == "delete_post") {
window.location.reload()
return false
}
targ.outerHTML = res
setup()
},
Expand Down

0 comments on commit 0f48251

Please sign in to comment.