- commit
- 2ce9a0bff91acf1ac0dc166ec5fa79129ad9aee9
- parent
- 6929c050772c51ed8f538ff13f8f8804b4dcbca2
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2018-10-19 10:05
add warning before delete
Diffstat
| M | static/main.js | 6 | ++++++ |
| M | templates/uploads.html | 2 | +- |
2 files changed, 7 insertions, 1 deletions
diff --git a/static/main.js b/static/main.js
@@ -27,4 +27,10 @@ 27 27 document.querySelectorAll('textarea').forEach(function(e) { 28 28 resize.call(e); 29 29 }); -1 30 -1 31 on(document, 'click', '[name="delete"]', function(event) { -1 32 if (!window.confirm('Are you sure you want to delete this?')) { -1 33 event.preventDefault(); -1 34 } -1 35 }); 30 36 })()
diff --git a/templates/uploads.html b/templates/uploads.html
@@ -7,7 +7,7 @@ 7 7 <a href="{{ url }}" target="_blank">{{ name }}</a> 8 8 <form method="post"> 9 9 <input type="hidden" name="name" value="{{ name }}">10 -1 <button class="button--danger">Delete</button>-1 10 <button class="button--danger" name="delete">Delete</button> 11 11 </form> 12 12 </li> 13 13 {% endfor %}