Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "close" event #58

Closed
christopherjanzen opened this issue Apr 27, 2021 · 1 comment
Closed

Add "close" event #58

christopherjanzen opened this issue Apr 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@christopherjanzen
Copy link

christopherjanzen commented Apr 27, 2021

Maybe I'm missing a technique that would easily allow me to watch for this, but it would be nice to have a "close" event like the "open", "next", and "previous" that are already available.

Use case: updating a slider slide index on close to match the lightbox's last open slide.

@ocean90 ocean90 added the enhancement New feature or request label May 1, 2021
@midzer
Copy link
Owner

midzer commented Jun 26, 2021

@christopherjanzen Thanks for filling.

I think this just involves putting

// Create and dispatch a new event
const closeEvent = new window.CustomEvent('close')

lightbox.dispatchEvent(closeEvent)

at the end of close().

Wanna contribute yourself, @christopherjanzen ?

This was referenced Jun 29, 2021
@midzer midzer closed this as completed Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants