diff --git a/themes/intotheeast/css/style.css b/themes/intotheeast/css/style.css index 8610f21..4695e0d 100644 --- a/themes/intotheeast/css/style.css +++ b/themes/intotheeast/css/style.css @@ -705,8 +705,10 @@ body::after { .feed-map-wrap.is-fullscreen .feed-map-link { display: none; } -.feed-map-wrap.is-fullscreen .feed-map-fs-open { display: none; } -.feed-map-wrap.is-fullscreen .feed-map-fs-close { display: block; } +.feed-map-wrap.is-fullscreen .feed-map-fs-open, +.home-map-col.is-fullscreen .feed-map-fs-open { display: none; } +.feed-map-wrap.is-fullscreen .feed-map-fs-close, +.home-map-col.is-fullscreen .feed-map-fs-close { display: block; } .feed-map-link { display: block; diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index 9879cde..72eb354 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -287,11 +287,22 @@ tripMap.on('load', function () { el.addEventListener('click', function () { var card = document.getElementById('entry-' + entry.slug); if (!card) return; - window.location.hash = 'entry-' + entry.slug; - setTimeout(function () { - card.classList.add('is-highlighted'); - setTimeout(function () { card.classList.remove('is-highlighted'); }, 700); - }, 350); + var mapCol = document.querySelector('.home-map-col'); + var isFs = mapCol && mapCol.classList.contains('is-fullscreen'); + function scrollAndHighlight() { + window.location.hash = 'entry-' + entry.slug; + setTimeout(function () { + card.classList.add('is-highlighted'); + setTimeout(function () { card.classList.remove('is-highlighted'); }, 700); + }, 350); + } + if (isFs) { + var fsBtn = document.getElementById('trip-map-fullscreen'); + if (fsBtn) fsBtn.click(); + setTimeout(scrollAndHighlight, 450); + } else { + scrollAndHighlight(); + } }); new maplibregl.Marker({ element: el }).setLngLat(lngLat).addTo(tripMap);