Open denbyangus opened 3 years ago
All good. I came up with a solution using a flag. :) vat lityon = false;
The flag is set when the lity object instantiates $(document).on('lity:ready' ... lityon = true;
and unset when the object is removed: $(document).on('lity:remove',... lityon = false;
I check the flag when I handle the keyup event to ensure I don't close the window after closing the lightbox.
I have implemented a window close when the user clicks the ESC key. Unfortunately the event propagates from the Lity close event (also triggered by an ESC action) and closes the window too.
I tried the following but I fear I'm too late.
Is there a handle closer to the close that I can use to insert the stopPropagation?