Skip to content

More events: afterShow, beforePreviewsChange, afterPreviewsChange #245

Open
@locinus

Description

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

At the moment (version 8), a few events (close, show, firstImage, ...) are available to hook on the different processes of the library, but they are partial and do not allow certain manipulations.

Expected behavior

Most of the events are triggered AFTER or BEFORE a process, but rarely both events exist for one process. Having both per process would allow a large panel of manipulations.
Following events would be especially useful:

  • afterClose - right after the modal view closes
  • afterShow - right after the modal image is visible
  • beforePreviewsChange - right before the previews will be updated
  • afterPreviewsChange - right after the previews have been updated

What is the motivation / use case for changing the behavior?

That would complete the sets of already existing events, allowing even more scenarios. If it was easy to implement, that would be a nice upgrade!
My usecase is to hack the rendering of previews (as long as custom templates are not available), for which 'show' is very useful, but I then have to rely on an arbitrary setTimeout to add modifications when the image and the previews are rendered.

Environment (the most important section to fill very carefully)


- @ks89/angular-modal-gallery version: 7.2.5
- Node version: 14.15.0
- npm version: 6.14.8
- Operating System and version:  Windows 10
- Angular version: 11.2.0
- angular-cli version: 11.2.4


By the way, great job here!
And very efficient. I was jauging different libraries to handle numerous images (several thousands), and this one is lightning fast!

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions