refactor(sync): remove formbuilder this._redraw() callbacks.

They are now handled in the `render()` call, so there is no more need
for them here.
This commit is contained in:
Alexis Métaireau 2024-05-31 14:55:02 +02:00
parent 5247bf77d3
commit 4e7ac23b53

View file

@ -172,7 +172,6 @@ U.FeatureMixin = {
properties.unshift('properties.name') properties.unshift('properties.name')
builder = new U.FormBuilder(this, properties, { builder = new U.FormBuilder(this, properties, {
id: 'umap-feature-properties', id: 'umap-feature-properties',
callback: this._redraw, // In case we have dynamic options…
}) })
container.appendChild(builder.build()) container.appendChild(builder.build())
this.appendEditFieldsets(container) this.appendEditFieldsets(container)
@ -203,7 +202,6 @@ U.FeatureMixin = {
const optionsFields = this.getShapeOptions() const optionsFields = this.getShapeOptions()
let builder = new U.FormBuilder(this, optionsFields, { let builder = new U.FormBuilder(this, optionsFields, {
id: 'umap-feature-shape-properties', id: 'umap-feature-shape-properties',
callback: this._redraw,
}) })
const shapeProperties = L.DomUtil.createFieldset(container, L._('Shape properties')) const shapeProperties = L.DomUtil.createFieldset(container, L._('Shape properties'))
shapeProperties.appendChild(builder.build()) shapeProperties.appendChild(builder.build())
@ -211,7 +209,6 @@ U.FeatureMixin = {
const advancedOptions = this.getAdvancedOptions() const advancedOptions = this.getAdvancedOptions()
builder = new U.FormBuilder(this, advancedOptions, { builder = new U.FormBuilder(this, advancedOptions, {
id: 'umap-feature-advanced-properties', id: 'umap-feature-advanced-properties',
callback: this._redraw,
}) })
const advancedProperties = L.DomUtil.createFieldset( const advancedProperties = L.DomUtil.createFieldset(
container, container,
@ -220,9 +217,7 @@ U.FeatureMixin = {
advancedProperties.appendChild(builder.build()) advancedProperties.appendChild(builder.build())
const interactionOptions = this.getInteractionOptions() const interactionOptions = this.getInteractionOptions()
builder = new U.FormBuilder(this, interactionOptions, { builder = new U.FormBuilder(this, interactionOptions)
callback: this._redraw,
})
const popupFieldset = L.DomUtil.createFieldset( const popupFieldset = L.DomUtil.createFieldset(
container, container,
L._('Interaction options') L._('Interaction options')
@ -778,7 +773,6 @@ U.Marker = L.Marker.extend({
builder.resetField('_latlng.lat') builder.resetField('_latlng.lat')
builder.resetField('_latlng.lng') builder.resetField('_latlng.lng')
} }
this._redraw()
this.zoomTo({ easing: false }) this.zoomTo({ easing: false })
}, },
callbackContext: this, callbackContext: this,