Modal JS API
Last updated
The JS API is primarily configured through SA5's Modal Controller.
This is exposed dorectly through SA5 Core's controllers;
window.sa5.controllers.modalsThese are some useful setups
Use a form modal as a "gate" for content access.
User must fill in the form to proceed
When the user has passed the gate they see the content
They do not need to re-pass the gate
You can use cookies, sessionStorage or localStorage to keep the gate "open" for subsequent visits.
display(modalName: string, force: boolean) show the item
modalName is the name of the modal as defined by the wfu-modal attribute.
force = true, will display the modal even when it is marked as suppressed in cookies.
Example;
closeAll()
Example;
Close on submit
wfu-modal-trigger-close-formsubmit=""
Link IFRAME to Modal automatic
Pre-defined modal default
v. Modal template
Pre-defined modals
Modals
Modal Templates
pre-defined modal
Element-sourced
URL IFRAME-sourced
modal
Explicit
modal template
Last updated
sa5.controllers.modals.display("modal1", true); sa5.controllers.modals.closeAll();