Remove item after deleting and close bootstrap modal

This commit is contained in:
TomMago 2020-09-02 00:25:22 +02:00
parent 49df2733f7
commit 006bda7858

View file

@ -176,20 +176,18 @@ function setKey() {
$(document).ready(function() { $(document).ready(function() {
// Button for delete a page in the table // Button for delete a page in the table
$(".select2-dropdown").css("z-index","1040");
// Event from button accept from the modal // Event from button accept from the modal
$(".deletePageModalAcceptButton").on("click", function() { $(".deletePageModalAcceptButton").on("click", function() {
console.log(key);
console.log(HTML_PATH_ADMIN_ROOT);
$( "body" ).append("<iframe name='formSending'></iframe>");
var form = jQuery('<form>', { var form = jQuery('<form>', {
'action': HTML_PATH_ADMIN_ROOT+'edit-content/'+key, 'action': HTML_PATH_ADMIN_ROOT+'edit-content/'+key,
'method': 'post', 'method': 'post',
'target': '_top' 'target': 'formSending'
}).append(jQuery('<input>', { }).append(jQuery('<input>', {
'type': 'hidden', 'type': 'hidden',
'name': 'tokenCSRF', 'name': 'tokenCSRF',
@ -205,6 +203,11 @@ $(document).ready(function() {
})))); }))));
form.hide().appendTo("body").submit(); form.hide().appendTo("body").submit();
$("#jsdeletePageModal").modal('hide');
$('.select2-search__field').trigger("input");
}); });
}); });
</script> </script>
@ -212,6 +215,6 @@ $(document).ready(function() {
<script> <script>
// Open the tab defined in the URL // Open the tab defined in the URL
const anchor = window.location.hash; // const anchor = window.location.hash;
$(`a[href="${anchor}"]`).tab('show'); // $(`a[href="${anchor}"]`).tab('show');
</script> </script>