From b4b5497b0950e0c0dfcb77b70857890e7aa769f5 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Mon, 22 May 2023 14:41:45 -0400 Subject: [PATCH] =?UTF-8?q?Follow=20up=20on=20#1090=20for=20overlay?= =?UTF-8?q?=E2=80=99s=20opacity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I missed that one and I fixed a bug in the meantime setting a correct label (vs. invisible placeholder for an input of type range). I set a fallback on the datalist id in case no label is specified (which is probably not a good idea). --- umap/static/umap/js/umap.forms.js | 2 +- umap/static/umap/js/umap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index 5fb8e231..072e5cf2 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -808,7 +808,7 @@ L.FormBuilder.Range = L.FormBuilder.Input.extend({ 'umap-field-datalist', this.getHelpTextParent() ) - datalist.id = `range-${this.options.label}` + datalist.id = `range-${this.options.label || this.name}` this.input.setAttribute('list', datalist.id) var options = '' for (var i = this.options.min; i <= this.options.max; i += this.options.step) { diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index ef81cc23..e60ef8ef 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1651,7 +1651,7 @@ L.U.Map.include({ ], [ 'options.overlay.opacity', - { handler: 'Range', min: 0, max: 1, step: 'any', placeholder: L._('opacity') }, + { handler: 'Range', min: 0, max: 1, step: 0.1, label: L._('Opacity') }, ], ['options.overlay.tms', { handler: 'Switch', label: L._('TMS format') }], ]