Skip to content

Commit

Permalink
test (LAST READY)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdarkle committed Sep 10, 2024
1 parent 90997c9 commit f10d736
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,14 @@ 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: true,
Hash: false, // Disable the default hash behavior
Hash: false,
};

postBody.querySelectorAll('a[data-fancybox]').forEach(link => {
Expand Down Expand Up @@ -108,6 +101,7 @@ 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 All @@ -116,4 +110,4 @@ app.initializers.add('darkle/fancybox', () => {
});
});
};
});
});

0 comments on commit f10d736

Please sign in to comment.