From 5bbbf6a98870655cd2250b28ad668037d9b77f2f Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 29 Aug 2024 12:21:51 +0200 Subject: [PATCH] fix: white space was broken since using loadTemplate Since a2ca3a143615fde971a5f908afae02b0487d62a4, the panel/popup template uses loadTemplate, which used to remove all white spaces from the inner html. We had to do this to workaround white space breaking the slideshow toolbox buttons. So this commits fixes this problem in another way: do not remove white space (usefull for text content in popup/panels), but use a display: flex instead of inline-block. --- umap/static/umap/css/slideshow.css | 2 +- .../umap/js/modules/rendering/template.js | 25 ++++++++++--------- umap/static/umap/js/modules/utils.js | 3 --- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/umap/static/umap/css/slideshow.css b/umap/static/umap/css/slideshow.css index c5084ccd..7d7e856c 100644 --- a/umap/static/umap/css/slideshow.css +++ b/umap/static/umap/css/slideshow.css @@ -5,7 +5,7 @@ display: none; } .umap-slideshow-enabled .umap-slideshow-toolbox { - display: inline-block; + display: flex; } .umap-slideshow-toolbox li { display: inline-block; diff --git a/umap/static/umap/js/modules/rendering/template.js b/umap/static/umap/js/modules/rendering/template.js index e972d662..19090b38 100644 --- a/umap/static/umap/js/modules/rendering/template.js +++ b/umap/static/umap/js/modules/rendering/template.js @@ -24,9 +24,9 @@ export default function loadTemplate(name, feature, container) { } class PopupTemplate { - renderTitle(feature, container) {} + renderTitle(feature) {} - renderBody(feature, container) { + renderBody(feature) { const template = feature.getOption('popupContentTemplate') const target = feature.getOption('outlinkTarget') const properties = feature.extendedProperties() @@ -40,7 +40,7 @@ class PopupTemplate { return Utils.loadTemplate(`
${content}
`) } - renderFooter(feature, container) { + renderFooter(feature) { if (feature.hasPopupFooter()) { const template = `