Closed daften closed 3 years ago
In 3.3.0 FsLightbox instance is passed as param to custom toolbar button onclick. So you can get the current source URL like this:
fsLightboxInstances['gallery'].props.customToolbarButtons = [{
onClick: (instance) => {
console.log(instance.props.sources[instance.stageIndexes.current]);
}
}];
Instead of the lightboxinstance, I get a PointerEvent though :s
E.g. to add a delete action, we need to know the URL / id of the current photo. Is this possible. Is it possible to pass the image object for the open/active image to the function being called?
https://fslightbox.com/javascript/documentation/toolbar