mirror of
https://github.com/JustKato/FreePad.git
synced 2026-02-23 15:50:46 +02:00
+ Deletion Confirmation
This commit is contained in:
@@ -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" .}}
|
||||
Reference in New Issue
Block a user