Closed (fixed)
Project:
PhotoSwipe - Responsive JavaScript Modal Image Gallery
Version:
3.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2022 at 11:18 UTC
Updated:
16 Aug 2022 at 13:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kimberlly_amaral commentedI'll try to work on that.
Comment #3
anybodyThank you Kimberly, also see #3092332: [5.x] Use native js, remove jQuery.
Comment #5
kimberlly_amaral commentedI made the change with the library. But this is my first issue working with jquery, if there is anything missing just tell me. I'll be glad to work on that.
Comment #6
lucienchalom commentedComment #7
diegorsI changed the Jquery.once() by the once() function in , I hope the change is correct.
Comment #8
lucasscI'll review this.
Comment #10
lucasscHi!
I reviewed and found the error below:
I created a MR for fix it, please review.
Comment #11
gquisini commentedI'll review.
Comment #12
gquisini commentedI reviewed and tested it.
I did not find any JS error or warning and all photoswipe styles worked well.
Comment #13
gquisini commentedComment #14
anybodyNeeds reroll, furthermore I'm not really happy with the current implementation in both MR's. I don't think the once will work that way. Please provide reference to show me I'm wrong.
Comment #15
lucasscHello @Anybody!
Thanks for reviewed. My implementation comes from here.
In line 38 of js/photoswipe.jquery.js is following the signature below:
once(id, elements (CSS selector string, Array, NodeList, jQuery), context (optional))I also kept the
$()to remain a jQuery object since it's calling.each()jQuery method.If you still think it's better to implement this in another way, please let me know by moving the issue status to "needs work".
Comment #17
lucasscSorry for comments above, I had trouble with the reroll.
I closed my MR, reroll Diego's MR and commit there. Check it out here.
Comment #18
diegorsComment #19
grevil commentedI can confirm, that the changes by are correct and are working as intended!
There is a great example in the link @lucassc provided:
Before:
After the new implementation:
(see https://www.drupal.org/node/3158256)
Thanks all! Merging this into dev.
Comment #20
grevil commented