CASH-498 - Block interaction with Foster Love widget while part is being added
This commit is contained in:
parent
6faffd877a
commit
f0a878ff44
2 changed files with 21 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="donation-block">
|
<div class="donation-block">
|
||||||
<form ref="donationForm" id="donation-form" @submit.prevent="handleDonationAction">
|
<form ref="donationForm" id="donation-form" @submit.prevent>
|
||||||
<div class="row g-0">
|
<div class="row g-0">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<p class="headline text-center" v-html="DonationHeadline"></p>
|
<p class="headline text-center" v-html="DonationHeadline"></p>
|
||||||
|
|
@ -52,9 +52,12 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<button
|
<buttonMain
|
||||||
class="btn btn-secondary w-100 mb-2"
|
ref="buttonMain"
|
||||||
v-html="DonationAddButtonCopy"></button>
|
:buttonText="DonationAddButtonCopy"
|
||||||
|
loaderColor="white"
|
||||||
|
class="w-100 mb-2"
|
||||||
|
@click-event="handleDonationAction" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -86,6 +89,7 @@
|
||||||
<script>
|
<script>
|
||||||
import textLink from "@/ux-components/text-link/text-link";
|
import textLink from "@/ux-components/text-link/text-link";
|
||||||
import alert from "@/ux-components/alert/alert";
|
import alert from "@/ux-components/alert/alert";
|
||||||
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
export default {
|
export default {
|
||||||
name: "donationBlock",
|
name: "donationBlock",
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -131,13 +135,20 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDonationAction(submitEvent) {
|
handleDonationAction() {
|
||||||
this.selectedValue = submitEvent.target.elements.amount.value;
|
const selectedAmount = this.$refs.donationForm.elements.amount?.value;
|
||||||
|
if (selectedAmount) {
|
||||||
|
this.selectedValue = selectedAmount;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
removeLoader() {
|
||||||
|
this.$refs.buttonMain.removeLoader();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
textLink,
|
textLink,
|
||||||
alert,
|
alert,
|
||||||
|
buttonMain,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,8 @@
|
||||||
:donationValues="donationValues"
|
:donationValues="donationValues"
|
||||||
:showDonationSuccess="showDonationSuccess"
|
:showDonationSuccess="showDonationSuccess"
|
||||||
:showDonationError="showDonationError"
|
:showDonationError="showDonationError"
|
||||||
@DonationAddedEvent="addDonationToOrder" />
|
@DonationAddedEvent="addDonationToOrder"
|
||||||
|
ref="donationBlock" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="mb-5" />
|
<hr class="mb-5" />
|
||||||
|
|
@ -544,10 +545,12 @@ export default {
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
this.lineItems = deepClone(this.getSubmittedOrder().lineItems);
|
this.lineItems = deepClone(this.getSubmittedOrder().lineItems);
|
||||||
|
this.$refs.donationBlock.removeLoader();
|
||||||
} else {
|
} else {
|
||||||
this.showDonationError = true;
|
this.showDonationError = true;
|
||||||
this.showDonationSuccess = false;
|
this.showDonationSuccess = false;
|
||||||
this.donationAmount = 0;
|
this.donationAmount = 0;
|
||||||
|
this.$refs.donationBlock.removeLoader();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue