From 110ec22dd782f33e59c651aa10363d0f57a4e205 Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Fri, 28 Jul 2023 12:20:59 +0200 Subject: [PATCH] disable remove product btn when click on the first time - issue #24 --- .../views/front/sable/js/components/BasketPanel.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/front/sable/js/components/BasketPanel.vue b/resources/views/front/sable/js/components/BasketPanel.vue index 07516092..fabbb4bd 100644 --- a/resources/views/front/sable/js/components/BasketPanel.vue +++ b/resources/views/front/sable/js/components/BasketPanel.vue @@ -38,7 +38,7 @@ - + @@ -79,12 +79,12 @@ }, data() { return { - processing: false, success:false, errors:false, showConfirmEmpty:false, response: '', - promotion_slide: -1 + promotion_slide: -1, + disableBtn: false, } }, mounted() { @@ -125,23 +125,24 @@ .catch(function (error) { console.log(error); this.response = "Erreur lors de la modification du panier."; - this.processing = false; }); } }, removeItem(rowId) { + this.disableBtn = true; axios.post('/ajax/remove-from-cart', { rowId: rowId, instance: 'panier', }).then( (response) => { this.updateStore(response.data); + this.disableBtn = false; } ) .catch(function (error) { console.log(error); this.response = "Erreur lors de la modification du panier."; - this.processing = false; + this.disableBtn = false; }); }, emptyCart() { @@ -157,7 +158,6 @@ .catch(function (error) { console.log(error); this.response = "Erreur lors de la modification du panier."; - this.processing = false; }); }, confirmEmpty() {