half way there

This commit is contained in:
Jason Wheeler 2023-04-06 14:58:12 -04:00
parent 47ae19653a
commit 4a08cbf38d
2 changed files with 18 additions and 3 deletions

View file

@ -91,11 +91,11 @@ export default {
},
openModal() {
const modal = Modal.getOrCreateInstance(document.getElementById(this.modalId));
modal.show();
modal?.show();
},
closeModal() {
const modal = Modal.getInstance(document.getElementById(this.modalId));
modal.hide();
modal?.hide();
},
},
computed: {

View file

@ -14,7 +14,7 @@
here
</p>
<a href="#!" data-bs-toggle="modal" data-bs-target="#ModalName" aria-label="Modal window">Wow!!</a>
<a id="test" href="#!" aria-label="Modal window">Wow!!</a>
<siteFooter
cmsWidgetName="SiteFooterWidget"
:isForwardActionDisabled="!meta.valid"
@ -64,6 +64,21 @@ export default {
alert("you clicked me!");
}
},
/* mounted: (
() => {
const element = document.getElementById("test");
element.addEventListener("click", () => app.openModal("ModalName") )
}
),
*/
mounted() {
console.log(document.getElementById("test"))
console.log(this.openModal);
const element = document.getElementById("test");
const modalname = "ModalName";
const openModal = this.openModal;
element.addEventListener("click", () => openModal(modalname) )
},
computed: {
bodyText() {
return this.getCmsContent("ModalLink", "BodyText");