Fixing adas link not working

This commit is contained in:
brydon1 2023-09-12 11:08:05 -04:00
parent 68a985d4e9
commit 3ed110485c
3 changed files with 21 additions and 4 deletions

View file

@ -463,7 +463,13 @@ export function setupModalLinks(context) {
for (const element of elements) { for (const element of elements) {
const target = element.getAttribute('modalTarget'); const target = element.getAttribute('modalTarget');
if (target) { if (target) {
element.addEventListener('click', () => context.$refs[target].openModal()); console.log('click event');
console.log(target)
console.log(element)
element.addEventListener('click', () =>{
console.log('hi');
context.$refs[target].openModal()
});
} }
} }
}); });

View file

@ -54,6 +54,7 @@ export default {
if (evt.persisted) { if (evt.persisted) {
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
console.log('reload');
}, 10); }, 10);
} }
}, },

View file

@ -217,6 +217,8 @@ export default {
return this.getHeaderTextFromCms('NextStepsWidget'); return this.getHeaderTextFromCms('NextStepsWidget');
}, },
nextStepsBody() { nextStepsBody() {
console.log('next steps body');
return this.getBodyTextFromCms('NextStepsWidget')?.replaceAll('{custom:damage}', this.damageText); return this.getBodyTextFromCms('NextStepsWidget')?.replaceAll('{custom:damage}', this.damageText);
}, },
continueWithSchedulingBodyText() { continueWithSchedulingBodyText() {
@ -314,10 +316,17 @@ export default {
} else { } else {
this.$refs.siteFooter.updateButtonText('Continue'); this.$refs.siteFooter.updateButtonText('Continue');
} }
},
nextStepsBody(newValue, oldValue) {
console.log('watching next step');
if (newValue !== oldValue){
setupModalLinks(this);
}
} }
}, },
async mounted() { async mounted() {
this.$refs.loadingModal.showModal(); this.$refs.loadingModal.showModal();
console.log("mounted");
setupModalLinks(this); setupModalLinks(this);
const vm = this; const vm = this;
if (this.policyLookupSuccessful if (this.policyLookupSuccessful
@ -325,6 +334,7 @@ export default {
&& this.coveredAndServicePriceAboveOrEqualDeductible) { && this.coveredAndServicePriceAboveOrEqualDeductible) {
await useMainStore().registerClaim()?.catch(() => {}); await useMainStore().registerClaim()?.catch(() => {});
} }
//setupModalLinks(this);
vm.$refs.loadingModal.hideModal(); vm.$refs.loadingModal.hideModal();
}, },
methods: { methods: {
@ -374,9 +384,9 @@ export default {
); );
} }
}, },
openModalAction(modalName) { // openModalAction(modalName) {
this.$refs[modalName.args].openModal(); // this.$refs[modalName.args].openModal();
}, // },
processIfStatements, processIfStatements,
getHeaderTextFromCms(cmsWidgetName) { getHeaderTextFromCms(cmsWidgetName) {
const header = this.getCmsContent(cmsWidgetName, 'HeaderText'); const header = this.getCmsContent(cmsWidgetName, 'HeaderText');