aboutsummaryrefslogtreecommitdiff
path: root/t_idea/index.html
diff options
context:
space:
mode:
Diffstat (limited to 't_idea/index.html')
-rw-r--r--t_idea/index.html19
1 files changed, 9 insertions, 10 deletions
diff --git a/t_idea/index.html b/t_idea/index.html
index f845628..97b68dd 100644
--- a/t_idea/index.html
+++ b/t_idea/index.html
@@ -40,24 +40,23 @@
<p><i>No ideas here... Be the first one to think!</i></p>
{{ end }}
</ul>
- <!--template-->
</body>
<script>
- let dels = document.querySelectorAll("form[action=\"/idea/delete/\"]")
- for (el of dels) {
+ let dels = document.querySelectorAll("form[action=\"/idea/delete/\"]");
+ for (let el of dels) {
el.addEventListener("submit", function(e) {
- e.preventDefault()
+ e.preventDefault();
if (confirm("are you sure?") === true) {
- this.submit()
+ this.submit();
}
})
}
- let eels = document.querySelectorAll("button.edit")
- for (el of eels) {
- el.onclick = function(e) {
- location.href = "/idea/edit?t=" + el.getAttribute("data-title")
+ let eels = document.querySelectorAll("button.edit");
+ for (let el of eels) {
+ el.onclick = function() {
+ let title = el.getAttribute("data-title");
+ location.href = "/idea/edit?t=" + title;
}
}
-
</script>
</html>