|
|
@ -54,9 +54,11 @@ export class TimelineComponent implements OnInit, OnDestroy {
|
|
|
|
private restoreScrollPosition() {
|
|
|
|
private restoreScrollPosition() {
|
|
|
|
const scrollPosition = sessionStorage.getItem('timelineScrollPosition');
|
|
|
|
const scrollPosition = sessionStorage.getItem('timelineScrollPosition');
|
|
|
|
if (scrollPosition) {
|
|
|
|
if (scrollPosition) {
|
|
|
|
requestAnimationFrame(() => {
|
|
|
|
window.scrollTo({
|
|
|
|
this.viewportScroller.scrollToPosition([0, parseInt(scrollPosition)]);
|
|
|
|
top: parseInt(scrollPosition),
|
|
|
|
|
|
|
|
behavior: 'smooth',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
sessionStorage.removeItem('timelineScrollPosition');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -93,8 +95,10 @@ export class TimelineComponent implements OnInit, OnDestroy {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
this.groupPinsByYear();
|
|
|
|
this.groupPinsByYear();
|
|
|
|
|
|
|
|
|
|
|
|
// Restaurer la position de défilement après le chargement initial
|
|
|
|
// Attendre que le DOM soit mis à jour avant de restaurer la position
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
this.restoreScrollPosition();
|
|
|
|
this.restoreScrollPosition();
|
|
|
|
|
|
|
|
}, 100);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|