Micromodal icon indicating copy to clipboard operation
Micromodal copied to clipboard

Init with custom target

Open erolabzait opened this issue 8 years ago • 3 comments
trafficstars

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 avatar Oct 18 '17 10:10 erolabzait

@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.

ghosh avatar Oct 18 '17 10:10 ghosh

That will be great, any timeline for v0.2.0?

erolabzait avatar Oct 18 '17 10:10 erolabzait

Nothing concrete yet, but sometime next week maybe. You can track it here - https://github.com/ghosh/micromodal/milestone/1

ghosh avatar Oct 18 '17 12:10 ghosh