From 53458053a753b7c2e9e98cbddb0041cde52ddc21 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 8 May 2024 19:05:52 +0200 Subject: [PATCH] wip: properly deal with old onLoadPanel 'facet' value We need to replace it, so the new value is saved and used elsewhere (eg. in the "UI options" form) --- umap/static/umap/js/umap.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index bcb6b2e6..b37767a5 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -149,6 +149,9 @@ U.Map = L.Map.extend({ if (this.options.datalayersControl === 'expanded') { this.options.onLoadPanel = 'datalayers' } + if (this.options.onLoadPanel === 'facet') { + this.options.onLoadPanel = 'datafilters' + } let isDirty = false // self status try { @@ -214,12 +217,12 @@ U.Map = L.Map.extend({ this.openBrowser('data') } else if (this.options.onLoadPanel === 'datalayers') { this.openBrowser('layers') + } else if (this.options.onLoadPanel === 'datafilters') { + this.panel.mode = 'expanded' + this.openBrowser('filters') } else if (this.options.onLoadPanel === 'caption') { this.panel.mode = 'condensed' this.displayCaption() - } else if (['facet', 'datafilters'].includes(this.options.onLoadPanel)) { - this.panel.mode = 'expanded' - this.openBrowser('filters') } if (L.Util.queryString('edit')) { if (this.hasEditMode()) this.enableEdit()