Closed (fixed)
Project:
Blazy PhotoSwipe
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2024 at 02:02 UTC
Updated:
17 Apr 2024 at 20:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gausarts commentedThank you.
Registering UI appears to work, however the current implementation is not really working well to accommodate events due to empty
pswp.pswpobject as per this writing.Be sure to add CSS accordingly to avoid confusion:
Conclusion, we need to inject pswp object manually, or refactor to use gallery element to support multiple instances rather than relying on global
Drupal.blazyPhotoSwipe.beforeInit.Comment #3
gausarts commentedThis is another sample for download link:
https://www.drupal.org/project/blazy_photoswipe/issues/3389181#comment-1...
Comment #4
gausarts commentedThe patch will make immutable
pswpobject available globally, while make it possible to work with individual elements.The last was taken from Slick convention which stores JS instance in the individual gallery element.
This sample will go to
Drupal.behaviors.attachblock:Adjust ES6 mix above accordingly, but fine though.
Also works fine with sample from #3.
Let me know if any betterment for this?
Comment #5
gausarts commentedIIRC, previously using non-indices keys for UI objects appeared to fail, but now works.
But then indices caused duplicated elements on subsequent launches, so I changed:
Drupal.blazyPhotoSwipe.ui[0] = {}, etc.to non-indices keys:
Drupal.blazyPhotoSwipe.ui.customCaption = {}, etc.Comment #7
gausarts commentedThis would do for now.
Improvements are welcome.
Thank you.
Comment #8
karlsheaAwesome, thank you so much! I'll give it a shot.