fix(blog): retour à la liste quand on clique sur Blog depuis un article
All checks were successful
Deploy / Deploy to Production (push) Successful in 20s
All checks were successful
Deploy / Deploy to Production (push) Successful in 20s
closes #10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e2df8d04e0
commit
7863828fb4
1 changed files with 7 additions and 0 deletions
|
|
@ -99,6 +99,13 @@ export function slideTo(path, { skipHistory = false } = {}) {
|
||||||
document.title = `World Game - ${slides.all[idx].title}`;
|
document.title = `World Game - ${slides.all[idx].title}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Si on navigue vers la slide déjà active (ex: clic sur "Blog" depuis un article),
|
||||||
|
// déclencher popstate pour que la vue puisse réagir au changement d'URL.
|
||||||
|
if (idx === slides.activeIndex && !skipHistory) {
|
||||||
|
window.dispatchEvent(new PopStateEvent('popstate'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
slides.slideTo(slidePath);
|
slides.slideTo(slidePath);
|
||||||
|
|
||||||
if (idx !== -1 && !slides.all[idx].loaded) {
|
if (idx !== -1 && !slides.all[idx].loaded) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue