Fixed deltion bug by waiting for the deletion request to finish
This commit is contained in:
parent
58c3e02306
commit
2d27356979
1 changed files with 7 additions and 7 deletions
|
@ -74,11 +74,8 @@
|
||||||
html += '<div class="search-suggestion-options">';
|
html += '<div class="search-suggestion-options">';
|
||||||
html += '<a target="_blank" href="'+DOMAIN_PAGES+data.id+'"><?php $L->p('view') ?></a>';
|
html += '<a target="_blank" href="'+DOMAIN_PAGES+data.id+'"><?php $L->p('view') ?></a>';
|
||||||
html += '<a class="ml-2" href="'+DOMAIN_ADMIN+'edit-content/'+data.id+'"><?php $L->p('edit') ?></a>';
|
html += '<a class="ml-2" href="'+DOMAIN_ADMIN+'edit-content/'+data.id+'"><?php $L->p('edit') ?></a>';
|
||||||
|
|
||||||
html += '<a href="#" onclick="setKey()" class="ml-2 text-danger deletePageButton d-block d-sm-inline" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'+data.id+'"><i class="fa fa-trash"></i><?php $L->p('Delete') ?></a>';
|
html += '<a href="#" onclick="setKey()" class="ml-2 text-danger deletePageButton d-block d-sm-inline" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'+data.id+'"><i class="fa fa-trash"></i><?php $L->p('Delete') ?></a>';
|
||||||
|
|
||||||
html += '</div></div>';
|
html += '</div></div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
@ -172,13 +169,12 @@ function setKey() {
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// Button for delete a page in the table
|
|
||||||
$(".select2-dropdown").css("z-index","1040");
|
$(".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() {
|
||||||
|
|
||||||
$( "body" ).append("<iframe name='formSending'></iframe>");
|
$( "body" ).append("<iframe id='formSendingIframe' 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,
|
||||||
|
@ -199,10 +195,14 @@ $(document).ready(function() {
|
||||||
}))));
|
}))));
|
||||||
|
|
||||||
form.hide().appendTo("body").submit();
|
form.hide().appendTo("body").submit();
|
||||||
|
|
||||||
$("#jsdeletePageModal").modal('hide');
|
$("#jsdeletePageModal").modal('hide');
|
||||||
|
|
||||||
$('.select2-search__field').trigger("input");
|
// Wait for request to finish before updating search results
|
||||||
|
$('#formSendingIframe').on( 'load', function() {
|
||||||
|
$('.select2-search__field').trigger("input");
|
||||||
|
} );
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue