🚸 Improved timeline
continuous-integration/drone/push Build encountered an error Details

master
Alexis Feron 1 week ago
parent 424c3567eb
commit d2c5a76993

@ -130,7 +130,9 @@
<button
type="button"
class="absolute top-0 left-0 z-30 flex items-center justify-center h-full cursor-pointer group focus:outline-none"
(click)="prevImage(pins.indexOf(pin))"
(click)="
prevImage(pins.indexOf(pin)); $event.stopPropagation()
"
>
<span
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-black/30 group-hover:bg-black/50"
@ -156,7 +158,9 @@
<button
type="button"
class="absolute top-0 right-0 z-30 flex items-center justify-center h-full cursor-pointer group focus:outline-none"
(click)="nextImage(pins.indexOf(pin))"
(click)="
nextImage(pins.indexOf(pin)); $event.stopPropagation()
"
>
<span
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-black/30 group-hover:bg-black/50"

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

Loading…
Cancel
Save