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 2770cf9 commit 730d7c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 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.

13 changes: 10 additions & 3 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@ app.initializers.add('darkle/fancybox', () => {
if (carouselEl) {
const carousel = carousels.get(carouselEl.id);
if (carousel) {
// Correctly align the slide index
carousel.slideTo(slide.index, { friction: 0 });
}
}
},
"init": (fancybox) => {
// Store the original URL
fancybox.originalUrl = window.location.href;
},
"destroy": (fancybox) => {
// Restore the original URL without triggering a page reload
history.replaceState(null, '', fancybox.originalUrl);
}
},
dragToClose: false, // Changed from true to false
dragToClose: false,
Hash: false, // Disable the default hash behavior
};

postBody.querySelectorAll('a[data-fancybox]').forEach(link => {
Expand Down Expand Up @@ -100,7 +108,6 @@ app.initializers.add('darkle/fancybox', () => {
if (carouselEl) {
const carousel = carousels.get(carouselEl.id);
if (carousel) {
// Ensure indices are correctly aligned
carousel.slideTo(slide.index, { friction: 0 });
}
}
Expand Down

0 comments on commit 730d7c5

Please sign in to comment.