fix(admin): render Leaflet maps in template preview
The .card wrapper has overflow:hidden which clips Leaflet's absolutely-positioned tile layers. Override to overflow:visible on the rendered-article card. Add .catch() to map fetch calls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Rendered article #}
|
||||
<div class="card">
|
||||
{# Rendered article — overflow:visible needed so Leaflet tile layers render #}
|
||||
<div class="card" style="overflow: visible;">
|
||||
<h2 class="text-lg mb-4">Rendered HTML</h2>
|
||||
<div class="article-body" style="max-width: none;">
|
||||
{{ preview.html | safe }}
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
bounds.push([c.lat, c.lon]);
|
||||
});
|
||||
if (bounds.length) map.fitBounds(bounds, { padding: [24, 24] });
|
||||
});
|
||||
})
|
||||
.catch(function(err) { console.error('Country map fetch failed:', err); });
|
||||
}
|
||||
|
||||
var VENUE_ICON = L.divIcon({
|
||||
@@ -94,7 +95,8 @@
|
||||
.bindTooltip(tip, { className: 'map-tooltip', direction: 'top', offset: [0, -7] })
|
||||
.addTo(map);
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(function(err) { console.error('City map fetch failed:', err); });
|
||||
}
|
||||
|
||||
/* Dynamically load Leaflet JS then init maps */
|
||||
|
||||
Reference in New Issue
Block a user