Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
  • Loading branch information
yohanboniface and davidbgk committed May 14, 2024
1 parent e6b4a54 commit 9e2a290
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions umap/static/umap/js/modules/caption.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 2 additions & 6 deletions umap/static/umap/js/umap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9e2a290

Please sign in to comment.