Micromodal
Micromodal copied to clipboard
Init with custom target
Hello,
Thank you for this awesome plugin.
In real projects i have a video / newsletter / ... modals, and they have custom onClose functions. Can you please adjust it to return an instance with .show() / .close() options if is initialised with a custom target?
const instance = MicroModal.init({ targetModal: customTargetId, onClose: md => {}, onShow: md => {} }); instance.show();
Thanks in advance, Erol
@erolabzait Hey, we are working on v0.2.0 which would allow you to pass a config for individual targets using the show() method. However, this method needs to be triggered manually on click.
MicroModal.show('customTarget', {
onShow: md => {},
onClose: md => {}
})
I understand what you are trying to achieve. Currently, there is no support of that, but it makes sense to have that ability.
We will slate for a future release. In the meantime maybe you can use the show() api once v0.2.0 lands.
That will be great, any timeline for v0.2.0?
Nothing concrete yet, but sometime next week maybe. You can track it here - https://github.com/ghosh/micromodal/milestone/1