diff --git a/themes/intotheeast/templates/home.html.twig b/themes/intotheeast/templates/home.html.twig index 58870d5..281ff61 100644 --- a/themes/intotheeast/templates/home.html.twig +++ b/themes/intotheeast/templates/home.html.twig @@ -152,7 +152,10 @@ homeMap.on('load', function () { .setHTML('' + entry.title + ''); el.addEventListener('mouseenter', function () { popup.addTo(homeMap); }); el.addEventListener('mouseleave', function () { popup.remove(); }); - el.addEventListener('click', function () { window.location.href = entry.url; }); + el.addEventListener('click', function () { + var card = document.getElementById('entry-' + entry.slug); + if (card) card.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }); new maplibregl.Marker({ element: el }).setLngLat(lngLat).addTo(homeMap); }); diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index c12b8da..087be2e 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -255,7 +255,10 @@ tripMap.on('load', function () { .setHTML('' + entry.title + ''); el.addEventListener('mouseenter', function () { popup.addTo(tripMap); }); el.addEventListener('mouseleave', function () { popup.remove(); }); - el.addEventListener('click', function () { window.location.href = entry.url; }); + el.addEventListener('click', function () { + var card = document.getElementById('entry-' + entry.slug); + if (card) card.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }); new maplibregl.Marker({ element: el }).setLngLat(lngLat).addTo(tripMap); });