diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index a77d7ae6..6163f298 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -754,13 +754,7 @@ const ControlsMixin = { const rightContainer = L.DomUtil.create('div', 'umap-right-edit-toolbox', container) const logo = L.DomUtil.create('div', 'logo', leftContainer) L.DomUtil.createLink('', logo, 'uMap', '/', null, L._('Go to the homepage')) - const nameButton = L.DomUtil.createButton( - 'map-name', - leftContainer, - '', - this.edit, - this - ) + const nameButton = L.DomUtil.createButton('map-name', leftContainer, '') L.DomEvent.on( nameButton, 'mouseover', @@ -809,7 +803,7 @@ const ControlsMixin = { update() this.once('saved', L.bind(update, this)) if (this.options.editMode === 'advanced') { - L.DomEvent.on(nameButton, 'click', this.edit, this) + L.DomEvent.on(nameButton, 'click', this.editCaption, this) L.DomEvent.on(shareStatusButton, 'click', this.permissions.edit, this.permissions) } this.on('postsync', L.bind(update, this)) diff --git a/umap/tests/integration/test_edit_map.py b/umap/tests/integration/test_edit_map.py index 4d397532..122eb864 100644 --- a/umap/tests/integration/test_edit_map.py +++ b/umap/tests/integration/test_edit_map.py @@ -21,6 +21,13 @@ def test_can_edit_name(page, live_server, tilelayer): ) +def test_can_edit_name_on_click_on_toolbar(page, live_server, tilelayer): + page.goto(f"{live_server.url}/en/map/new/") + page.locator(".map-name").click() + name_input = page.locator('.map-metadata input[name="name"]') + expect(name_input).to_be_visible() + + def test_map_name_impacts_ui(live_server, page, tilelayer): page.goto(f"{live_server.url}/en/map/new/")