Merge pull request #1090 from umap-project/877-sliders-thickness

Display the steps for inputs of type range
This commit is contained in:
Yohan Boniface 2023-05-19 12:09:06 +02:00 committed by GitHub
commit cd32b0eb3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -512,6 +512,13 @@ i.info {
.umap-browse-datalayers { .umap-browse-datalayers {
padding: 0 10px; padding: 0 10px;
} }
.umap-field-datalist {
display: flex;
justify-content: space-between;
font-size: 9px;
margin-top: -8px;
padding: 0 5px;
}
.umap-form-iconfield { .umap-form-iconfield {
position: relative; position: relative;
overflow: hidden; overflow: hidden;

View file

@ -801,6 +801,23 @@ L.FormBuilder.Range = L.FormBuilder.Input.extend({
value: function () { value: function () {
return L.DomUtil.hasClass(this.wrapper, 'undefined') ? undefined : this.input.value return L.DomUtil.hasClass(this.wrapper, 'undefined') ? undefined : this.input.value
}, },
buildHelpText: function () {
var datalist = L.DomUtil.create(
'datalist',
'umap-field-datalist',
this.getHelpTextParent()
)
datalist.id = `range-${this.options.label}`
this.input.setAttribute('list', datalist.id)
var options = ''
for (var i = this.options.min; i <= this.options.max; i += this.options.step) {
options += `<option value="${i.toPrecision(2)}" label="${i.toPrecision(
2
)}"></option>`
}
datalist.innerHTML = options
},
}) })
L.FormBuilder.ManageOwner = L.FormBuilder.Element.extend({ L.FormBuilder.ManageOwner = L.FormBuilder.Element.extend({