From c8eaa0cc3fd8133376bfccdb685bbcb631cf534e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 19 Apr 2022 17:30:21 +0200 Subject: [PATCH] Fix component loader --- .../js/components/media-manager/ActionsComponent.vue | 12 ++++++++++++ .../media-editor/tabs/EditComponent.vue | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/resources/js/components/media-manager/ActionsComponent.vue b/resources/js/components/media-manager/ActionsComponent.vue index 755381a..034d277 100644 --- a/resources/js/components/media-manager/ActionsComponent.vue +++ b/resources/js/components/media-manager/ActionsComponent.vue @@ -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"}) } diff --git a/resources/js/components/media-manager/media-editor/tabs/EditComponent.vue b/resources/js/components/media-manager/media-editor/tabs/EditComponent.vue index ef97e4d..32bc6a1 100644 --- a/resources/js/components/media-manager/media-editor/tabs/EditComponent.vue +++ b/resources/js/components/media-manager/media-editor/tabs/EditComponent.vue @@ -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"})