From 9e2a29002a2d22541e84dd9e09ef007c717269cf Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 14 May 2024 17:09:17 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com> --- umap/static/umap/js/modules/caption.js | 6 +++--- umap/static/umap/js/umap.js | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/umap/static/umap/js/modules/caption.js b/umap/static/umap/js/modules/caption.js index 3374eabc..9ebe01ce 100644 --- a/umap/static/umap/js/modules/caption.js +++ b/umap/static/umap/js/modules/caption.js @@ -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( diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index e99d346e..8bc9ac21 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -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) {