Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove postsync in captionBar and let map.propagate do its job #2227

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions umap/static/umap/js/umap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand All @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion umap/tests/integration/test_edit_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down