Add delete confirmation
This commit is contained in:
parent
01c96357ea
commit
212381a5c3
2 changed files with 27 additions and 0 deletions
|
@ -58,6 +58,11 @@ $(document).ready(function() {
|
|||
|
||||
$("#remove-btn").on("click", function(event) {
|
||||
event.preventDefault();
|
||||
$('#deletion-modal').modal('show');
|
||||
});
|
||||
|
||||
$("#deletion-confirm-btn").on("click", function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: window.location.pathname,
|
||||
|
|
|
@ -300,6 +300,28 @@
|
|||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if is_created}}
|
||||
<div class="modal fade hide" id="deletion-modal" tabindex="-1" role="dialog" aria-labelledby="deletion-modal-label" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="deletion-modal-label">
|
||||
<i class="fas fa-trash"></i>
|
||||
Delete this paste?
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="deletion-modal-close-btn">Cancel</button>
|
||||
<button type="button" class="btn btn-danger" id="deletion-confirm-btn">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<script>
|
||||
var uri_prefix="{{uri_prefix}}";
|
||||
|
||||
|
|
Loading…
Reference in a new issue