Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdarkle committed Sep 9, 2024
1 parent 5c1ef94 commit 1d20b6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ app.initializers.add('darkle/fancybox', () => {
}
},
"Carousel.change": (fancybox, carousel, slideIndex) => {
const slide = fancybox.getSlide();
const carouselEl = slide.triggerEl.closest('.fancybox-gallery');
const carouselEl = fancybox.getSlide().triggerEl.closest('.fancybox-gallery');
if (carouselEl) {
const carousel = carousels.get(carouselEl.id);
if (carousel) {
Expand Down Expand Up @@ -102,13 +101,12 @@ app.initializers.add('darkle/fancybox', () => {
});

// Sync slide changes between Carousel and Fancybox
fancyboxInstance.Carousel.on('change', (carousel, slide) => {
const currentSlideIndex = slide.index;
const carouselEl = slide.triggerEl.closest('.fancybox-gallery');
fancyboxInstance.on('Carousel.change', (fancybox, carousel, slideIndex) => {
const carouselEl = fancybox.getSlide().triggerEl.closest('.fancybox-gallery');
if (carouselEl) {
const carousel = carousels.get(carouselEl.id);
if (carousel) {
carousel.slideTo(currentSlideIndex, { friction: 0 });
carousel.slideTo(slideIndex, { friction: 0 });
}
}
});
Expand Down

0 comments on commit 1d20b6e

Please sign in to comment.