From ba6371381a9ea89d35c8c769a10acda2300603a0 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 8 Jan 2024 12:00:19 +0100 Subject: [PATCH] Better margin around popup title icon --- umap/static/umap/js/umap.popup.js | 1 + umap/static/umap/map.css | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.popup.js b/umap/static/umap/js/umap.popup.js index dad054a3..02ce1bf8 100644 --- a/umap/static/umap/js/umap.popup.js +++ b/umap/static/umap/js/umap.popup.js @@ -271,6 +271,7 @@ L.U.PopupTemplate.OSM = L.U.PopupTemplate.Default.extend({ title.style.backgroundColor = color const iconUrl = this.feature.getDynamicOption('iconUrl') let icon = L.U.Icon.makeIconElement(iconUrl, title) + L.DomUtil.addClass(icon, 'icon') L.U.Icon.setIconContrast(icon, title, iconUrl, color) if (L.DomUtil.contrastedColor(title, color)) title.style.color = 'white' L.DomUtil.add('span', '', title, this.getName()) diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index b56c4967..06d613b3 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -1277,8 +1277,8 @@ a.add-datalayer:hover, display: flex; align-items: center; } -.popup-title img { - margin: 0 5px; +.popup-title .icon { + margin: 5px; } a[href^='mailto']::before { content: '🖃 ';