1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-02-23 15:50:46 +02:00

+ Deletion Confirmation

This commit is contained in:
2022-06-03 22:59:44 +03:00
parent d056a4d429
commit faff1ab527
2 changed files with 16 additions and 2 deletions

View File

@@ -58,9 +58,9 @@
{{ $element.LastModified }}
</div>
<div class="col-2">
<a href="#" class="btn btn-danger">
<div onclick="doDelete(`{{ $element.Name }}`)" class="btn btn-danger">
Delete
</a>
</div>
</div>
</div>
@@ -75,4 +75,14 @@
{{ template "inc/theme-toggle.html" .}}
</body>
<script>
function doDelete(id) {
// Confirm deletion
if ( confirm("Confirm pad deletion?") ) {
// Do delete
window.location.href = `/admin/delete/${id}`;
}
}
</script>
{{ template "inc/footer.html" .}}