Group all lightbox elements in a discussion

I need to group all the .lightbox elements in a discussion.
Does someone has any idea where i should call lightbox.js in order to get fired when all the discussion is ready, not each individual post?

So far i figured out that:
Lightbox is set up in lib/lightbox.js and is called after DOM is rendered by api.decorateCooked() which just pass a callback function to addDecorator()
addDecorator has as argument, a DOM element cooked.

Lightbox.js is actually called in the context of each post replay.
Basically if in lightbox.js i do:
console.log(’.lighbox’) i get always one or as many picture EACH SINGLE USER added to each replay.
I need instead to get ALL the image that are in the whole discussion.

So far the only place where i found lightbox.js called is in post-decoration.js, which it confuse me a little…

Can you describe what you are trying to achieve? It will help us help you :wink:

1 Like

:slight_smile: yes sure. I want to create gallery between all the images in a discussion.
Like is required here: Navigating between images within a post

btw, is this a good category for questions like this one?

4 Likes