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)
This commit is contained in:
Yohan Boniface 2024-05-08 19:05:52 +02:00
parent 99effc880b
commit 53458053a7

View file

@ -149,6 +149,9 @@ U.Map = L.Map.extend({
if (this.options.datalayersControl === 'expanded') { if (this.options.datalayersControl === 'expanded') {
this.options.onLoadPanel = 'datalayers' this.options.onLoadPanel = 'datalayers'
} }
if (this.options.onLoadPanel === 'facet') {
this.options.onLoadPanel = 'datafilters'
}
let isDirty = false // self status let isDirty = false // self status
try { try {
@ -214,12 +217,12 @@ U.Map = L.Map.extend({
this.openBrowser('data') this.openBrowser('data')
} else if (this.options.onLoadPanel === 'datalayers') { } else if (this.options.onLoadPanel === 'datalayers') {
this.openBrowser('layers') this.openBrowser('layers')
} else if (this.options.onLoadPanel === 'datafilters') {
this.panel.mode = 'expanded'
this.openBrowser('filters')
} else if (this.options.onLoadPanel === 'caption') { } else if (this.options.onLoadPanel === 'caption') {
this.panel.mode = 'condensed' this.panel.mode = 'condensed'
this.displayCaption() this.displayCaption()
} else if (['facet', 'datafilters'].includes(this.options.onLoadPanel)) {
this.panel.mode = 'expanded'
this.openBrowser('filters')
} }
if (L.Util.queryString('edit')) { if (L.Util.queryString('edit')) {
if (this.hasEditMode()) this.enableEdit() if (this.hasEditMode()) this.enableEdit()