Fix component loader

This commit is contained in:
Jérémy Munsch 2022-04-19 17:30:21 +02:00
parent dd0c611845
commit c8eaa0cc3f
No known key found for this signature in database
GPG key ID: 55196BEE445F6049
2 changed files with 16 additions and 4 deletions

View file

@ -177,6 +177,10 @@
if(!value) {
return;
}
self.$store.commit({
type: 'Loading',
loading: true
})
$.ajax({
url: '/ajax/remove-media',
method: 'POST',
@ -185,6 +189,10 @@
medias: medias.map(function(obj) { return obj.id })
},
success: function(result) {
self.$store.commit({
type: 'Loading',
loading: false
})
let reload = function() {
self.$store.commit({
type: 'Reload',
@ -203,6 +211,10 @@
}
},
error: function(jqXHR, textStatus, errorThrown) {
self.$store.commit({
type: 'Loading',
loading: false
})
$.fancybox.close()
$.fancyMessage({title : "Attention", message : "Erreur lors de la suppression du média, merci d'actualiser la page.", type : "error"})
}

View file

@ -427,8 +427,8 @@
}
self.$store.commit({
type: 'Loading',
reload: true
});
loading: true
})
$.ajax({
url: '/ajax/remove-media',
method: 'POST',
@ -439,7 +439,7 @@
success: function(result){
self.$store.commit({
type: 'Loading',
reload: false
loading: false
})
if(result.length != 1) {
$.fancybox.close()
@ -459,7 +459,7 @@
error: function(jqXHR, textStatus, errorThrown) {
self.$store.commit({
type: 'Loading',
reload: false
loading: false
})
$.fancybox.close()
$.fancyMessage({title : "Attention", message : "Erreur lors de la suppression du média, merci d'actualiser la page.", type : "error"})