chore: remove the need for makeDirty in U.FormBuilder

This commit is contained in:
Yohan Boniface 2024-04-19 12:55:35 +02:00
parent 53f93ee97e
commit 9c326d09e1
3 changed files with 4 additions and 8 deletions

View file

@ -142,8 +142,7 @@ export default class Browser {
['options.filter', { handler: 'Input', placeholder: translate('Filter') }], ['options.filter', { handler: 'Input', placeholder: translate('Filter') }],
['options.inBbox', { handler: 'Switch', label: translate('Current map view') }], ['options.inBbox', { handler: 'Switch', label: translate('Current map view') }],
] ]
const builder = new U.FormBuilder(this, fields, { const builder = new L.FormBuilder(this, fields, {
makeDirty: false,
callback: () => this.onFormChange(), callback: () => this.onFormChange(),
}) })
formContainer.appendChild(builder.build()) formContainer.appendChild(builder.build())

View file

@ -103,8 +103,7 @@ export default class Facets {
] ]
}) })
const builder = new U.FormBuilder(this, fields, { const builder = new L.FormBuilder(this, fields, {
makeDirty: false,
callback: filterFeatures, callback: filterFeatures,
callbackContext: this, callbackContext: this,
}) })

View file

@ -1117,10 +1117,8 @@ U.FormBuilder = L.FormBuilder.extend({
setter: function (field, value) { setter: function (field, value) {
L.FormBuilder.prototype.setter.call(this, field, value) L.FormBuilder.prototype.setter.call(this, field, value)
if (this.options.makeDirty !== false) {
this.obj.isDirty = true this.obj.isDirty = true
if ('render' in this.obj) this.obj.render([field], this) if ('render' in this.obj) this.obj.render([field], this)
}
}, },
finish: function () { finish: function () {