diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index ee6b03498..7ec090aab 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -35,7 +35,7 @@ ref="buttonMain" suppressLoader :buttonText="ModalCloseButtonText" - @click-event="buttonMainClick" /> + @click-event="footerButtonClick" /> @@ -49,8 +49,11 @@ export default { name: "modal", props: { cmsWidgetName: String, - buttonClick: { + + footerButtonCallback: { type: Function, + // return true to close modal + // if undefined, footer button closes modal }, }, computed: { @@ -73,12 +76,7 @@ export default { return this.getCmsContent(this.cmsWidgetName, "FooterText"); }, showModalBody() { - return ( - this.ModalImage || - this.ModalHeadline || - this.ModalSubheadertext || - this.ModalBodyText - ); + return this.ModalBodyText; }, }, methods: { @@ -88,9 +86,11 @@ export default { closeModal() { this.$refs.modalXButton.click(); }, - buttonMainClick() { - if (this.buttonClick) { - this.buttonClick(); + async footerButtonClick() { + if (this.footerButtonCallback) { + if (await this.footerButtonCallback()) { + this.closeModal(); + } } else { this.closeModal(); } diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue index 68f30abff..1c9edd563 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue @@ -16,7 +16,10 @@ aria-label="Modal window" /> - +