From 2a04af162af4df63b36b73609e48b6754c401854 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 21 Jun 2023 12:00:34 +0200 Subject: [PATCH] Make outlink and outlinkTarget available for each feature It was only for polygon until then. cf #323 --- umap/static/umap/js/umap.features.js | 15 ++------------- umap/static/umap/js/umap.forms.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 9b7ac8b2..67d1e346 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -173,6 +173,8 @@ L.U.FeatureMixin = { 'properties._umap_options.showLabel', 'properties._umap_options.labelDirection', 'properties._umap_options.labelInteractive', + 'properties._umap_options.outlink', + 'properties._umap_options.outlinkTarget', ] }, @@ -1045,19 +1047,6 @@ L.U.Polygon = L.Polygon.extend({ inheritable: true, }, ], - [ - 'properties._umap_options.outlink', - { - label: L._('Link to…'), - helpEntries: 'outlink', - placeholder: 'http://...', - inheritable: true, - }, - ], - [ - 'properties._umap_options.outlinkTarget', - { handler: 'OutlinkTarget', label: L._('Open link in…'), inheritable: true }, - ], ] return options.concat(L.U.FeatureMixin.getInteractionOptions()) }, diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index 7883e306..19f6ad90 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -1045,6 +1045,17 @@ L.U.FormBuilder = L.FormBuilder.extend({ label: L._('Labels are clickable'), inheritable: true, }, + outlink: { + label: L._('Link to…'), + helpEntries: 'outlink', + placeholder: 'http://...', + inheritable: true, + }, + outlinkTarget: { + handler: 'OutlinkTarget', + label: L._('Open link in…'), + inheritable: true, + }, labelKey: { helpEntries: 'labelKey', placeholder: L._('Default: name'),