From 41306ad06681b27061f41d97dd7c8484ef015827 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Mon, 19 Oct 2020 21:06:10 +0200
Subject: Some frontend things
---
quotes/public/script.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'quotes/public/script.js')
diff --git a/quotes/public/script.js b/quotes/public/script.js
index cf3229a..3e6f52e 100644
--- a/quotes/public/script.js
+++ b/quotes/public/script.js
@@ -29,12 +29,13 @@ function appendQuote(response) {
"beforeend",
`
${elem["name"]} ${elem["middlename"] ? elem["middlename"] + " " : ""}${elem["surname"]}: ${
elem["quote"]
- }${elem["owner"] ? ' [x]' : ""}`,
+ }${elem["owner"] ? ' ' : ""}`,
);
const span = document.querySelector(`li span[data-id="${elem["id"]}"]`);
if (span)
span.addEventListener("click", (event) => {
+ if (!confirm("Bist du dir sicher, dass du das Zitat löschen willst?")) return;
fetch("api/delete/" + event.target.getAttribute("data-id"), { method: "DELETE" })
.then((response) => response.text())
.then((response) => {
--
cgit v1.2.3