fix(theme): hide the map fullscreen button when the map never initialises
The entry-map partial always rendered .feed-map-fullscreen-btn, but the MapLibre init AND the button's click wiring only run when entries exist — so on the home pre-departure state (active trip, no published posts) mobile showed a dead button floating over an empty 40vh map area. Gate the button on the same entries|length condition as the init script; it reappears with the first published post, exactly when it becomes functional. Covers any zero-entry trip page too (shared partial). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0195b3cDdMeize2Mm1FgC2aU
This commit is contained in:
@@ -23,12 +23,18 @@
|
|||||||
#}
|
#}
|
||||||
<div class="home-map-col">
|
<div class="home-map-col">
|
||||||
<div class="home-map" id="{{ map_id }}">
|
<div class="home-map" id="{{ map_id }}">
|
||||||
|
{# Same gate as the init script below: without entries the map never
|
||||||
|
initialises and nothing wires the button's click handler, so on
|
||||||
|
mobile (the only viewport where it shows) it would float as a dead
|
||||||
|
control over an empty map area (home pre-departure state). #}
|
||||||
|
{% if entries|length > 0 %}
|
||||||
<button class="feed-map-fullscreen-btn" id="{{ map_id }}-fullscreen" aria-label="Expand map">
|
<button class="feed-map-fullscreen-btn" id="{{ map_id }}-fullscreen" aria-label="Expand map">
|
||||||
<svg class="feed-map-fs-open" aria-hidden="true" width="14" height="14" viewBox="0 0 14 14" fill="currentColor">
|
<svg class="feed-map-fs-open" aria-hidden="true" width="14" height="14" viewBox="0 0 14 14" fill="currentColor">
|
||||||
<path d="M0 0v4h1.5V1.5H4V0z M14 0H10v1.5h2.5V4H14z M0 14v-4h1.5v2.5H4V14z M14 14H10v-1.5h2.5V10H14z"/>
|
<path d="M0 0v4h1.5V1.5H4V0z M14 0H10v1.5h2.5V4H14z M0 14v-4h1.5v2.5H4V14z M14 14H10v-1.5h2.5V10H14z"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="feed-map-fs-close" aria-hidden="true">✕</span>
|
<span class="feed-map-fs-close" aria-hidden="true">✕</span>
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user