From 6f12caf7d625f0bfffd2b138897fd8c711a6b2f5 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Sat, 10 Jun 2023 20:46:13 +0200 Subject: [PATCH 1/1] map --- src/references/templates/references/map.html | 23 +++++++++++++------ .../templates/references/popup.html | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/references/templates/references/map.html b/src/references/templates/references/map.html index e97ccbfb7..1aadfc4c2 100644 --- a/src/references/templates/references/map.html +++ b/src/references/templates/references/map.html @@ -14,13 +14,19 @@ {% endblock %} @@ -45,7 +51,10 @@ $.get( '/pinezki/popup/' + m.target.options.mid, function(data) { - let p = L.popup({minWidth: 106}).setLatLng(m.latlng).setContent(data); + d = $(data); + n = Math.min(3, ($('a', d).length)); + w = 111 * n - 5; + let p = L.popup({minWidth: w}).setLatLng(m.latlng).setContent(data); map.openPopup(p); } ); diff --git a/src/references/templates/references/popup.html b/src/references/templates/references/popup.html index 506cb3292..170827370 100644 --- a/src/references/templates/references/popup.html +++ b/src/references/templates/references/popup.html @@ -1,7 +1,7 @@ {% load thumbnail %}

{{ entity.label }}

-
+