fix: deactivate loader on map fragments

Since 8ddc570e23 we lost the link
request <=> map, so the "dataloading" and "dataload" events are
global to the DOM, so when loading a list of maps, all instances
react to all dataloading events, which makes the list a mess.

I'd prefer to keep this loading indicator per map, but it's much
easier to just hide it, so let's go that way.
This commit is contained in:
Yohan Boniface 2024-07-30 14:28:41 +02:00
parent 8c7ff52f5f
commit 084c674847

View file

@ -62,8 +62,10 @@ U.Map = L.Map.extend({
this.editPanel = new U.EditPanel(this) this.editPanel = new U.EditPanel(this)
this.fullPanel = new U.FullPanel(this) this.fullPanel = new U.FullPanel(this)
} }
L.DomEvent.on(document.body, 'dataloading', (e) => this.fire('dataloading', e)) if (!this.options.noControl) {
L.DomEvent.on(document.body, 'dataload', (e) => this.fire('dataload', e)) L.DomEvent.on(document.body, 'dataloading', (e) => this.fire('dataloading', e))
L.DomEvent.on(document.body, 'dataload', (e) => this.fire('dataload', e))
}
this.server = new U.ServerRequest() this.server = new U.ServerRequest()
this.request = new U.Request() this.request = new U.Request()