Apply suggestions from code review

Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
This commit is contained in:
Yohan Boniface 2024-05-14 17:09:17 +02:00 committed by Yohan Boniface
parent e6b4a54499
commit 9e2a29002a
2 changed files with 5 additions and 9 deletions

View file

@ -31,7 +31,7 @@ export default class Caption {
const p = DomUtil.create('p', 'datalayer-legend', container),
legend = DomUtil.create('span', '', p),
headline = DomUtil.create('strong', '', p)
datalayer.onceLoaded(function () {
datalayer.onceLoaded(() => {
datalayer.renderLegend(legend)
if (datalayer.options.description) {
DomUtil.element({
@ -89,8 +89,8 @@ export default class Caption {
const urls = {
leaflet: 'http://leafletjs.com',
django: 'https://www.djangoproject.com',
umap: 'http://wiki.openstreetmap.org/wiki/UMap',
changelog: 'https://umap-project.readthedocs.io/en/master/changelog/',
umap: 'https://umap-project.org/',
changelog: 'https://docs.umap-project.org/en/master/changelog/',
version: this.map.options.umap_version,
}
const creditHTML = translate(

View file

@ -912,15 +912,11 @@ U.Map = L.Map.extend({
},
openBrowser: function (mode) {
this.onceDatalayersLoaded(function () {
this.browser.open(mode)
})
this.onceDatalayersLoaded(() => this.browser.open(mode))
},
openCaption: function () {
this.onceDatalayersLoaded(function () {
this.caption.open()
})
this.onceDatalayersLoaded(() => this.caption.open())
},
eachDataLayer: function (method, context) {