From 132be80a4841925a9f582f08bca3975a1b88a876 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 21 Oct 2024 15:51:07 +0200 Subject: [PATCH] chore: remove postsync in captionBar and let map.propagate do its job --- umap/static/umap/js/umap.js | 7 +------ umap/tests/integration/test_edit_map.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index bb399b07..d166651f 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1594,7 +1594,7 @@ U.Map = L.Map.extend({ 'umap-caption-bar', this._controlContainer ) - const name = L.DomUtil.create('h3', '', container) + const name = L.DomUtil.create('h3', 'map-name', container) L.DomEvent.disableClickPropagation(container) this.addAuthorLink('span', container) if (this.getOption('captionMenus')) { @@ -1620,11 +1620,6 @@ U.Map = L.Map.extend({ ) } } - const setName = function () { - name.textContent = this.getDisplayName() - } - L.bind(setName, this)() - this.on('postsync', L.bind(setName, this)) this.onceDatalayersLoaded(function () { this.slideshow.renderToolbox(container) }) diff --git a/umap/tests/integration/test_edit_map.py b/umap/tests/integration/test_edit_map.py index 4dfa3704..6328d699 100644 --- a/umap/tests/integration/test_edit_map.py +++ b/umap/tests/integration/test_edit_map.py @@ -23,7 +23,7 @@ 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() + page.locator(".umap-main-edit-toolbox .map-name").click() name_input = page.locator('.map-metadata input[name="name"]') expect(name_input).to_be_visible()