some fix on delete action
Change-Id: I0cda12e120c92ded03bdd7c87c66aceb410ea927
Signed-off-by: lombardofr <lombardo@everyup.it>
diff --git a/vimhandler/template/vim_list.html b/vimhandler/template/vim_list.html
index 6823c72..07cb857 100644
--- a/vimhandler/template/vim_list.html
+++ b/vimhandler/template/vim_list.html
@@ -96,7 +96,30 @@
function deleteVim(url) {
bootbox.confirm("Are you sure want to delete?", function (result) {
if (result) {
- location.href = url//'/vims/' + vim_uuid + '/delete'
+ var dialog = bootbox.dialog({
+ message: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>',
+ closeButton: true
+ });
+ $.ajax({
+ url: url,
+ type: 'GET',
+ dataType: "json",
+ contentType: "application/json;charset=utf-8",
+ success: function (result) {
+ if (result['error'] == true) {
+ dialog.modal('hide');
+ bootbox.alert("An error occurred.");
+ }
+ else {
+ dialog.modal('hide');
+ location.reload();
+ }
+ },
+ error: function (error) {
+ dialog.modal('hide');
+ bootbox.alert("An error occurred.");
+ }
+ });
}
})
}