Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdarkle committed Sep 8, 2024
1 parent 68f1197 commit 9499e76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 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.

16 changes: 2 additions & 14 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ app.initializers.add('darkle/fancybox', () => {
new Carousel(gallery, {
Dots: false,
infinite: false,
dragFree: false,
});
}
});
Expand All @@ -48,24 +47,13 @@ app.initializers.add('darkle/fancybox', () => {
Images: {
initialSize: 'fit',
},
on: {
done: (fancybox, slide) => {
const carouselEl = slide.triggerEl.closest('.fancybox-gallery');
if (carouselEl) {
const carousel = Carousel.getInstance(carouselEl);
if (carousel) {
carousel.slideTo(slide.index, { friction: 0 });
}
}
},
},
});

// Prevent default link behavior
postBody.querySelectorAll('a[data-fancybox]').forEach(link => {
link.addEventListener('click', (e) => {
link.onclick = (e) => {
e.preventDefault();
});
};
});
};
});

0 comments on commit 9499e76

Please sign in to comment.