From fc9ffdf228eb233c39e1b3f0648accf86cbd9694 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 16 Jun 2018 22:56:23 +0200 Subject: [PATCH] Change URL at each save in case the map name has changed fix #555 --- umap/static/umap/js/umap.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 173c614f..2d2cc8b8 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1073,9 +1073,10 @@ L.U.Map.include({ if (!this.options.umap_id) { duration = 100000; // we want a longer message at map creation (TODO UGLY) this.options.umap_id = data.id; - if (history && history.pushState) history.pushState({}, this.options.name, data.url); - else window.location = data.url; } + // Update URL in case the name has changed. + if (history && history.pushState) history.pushState({}, this.options.name, data.url); + else window.location = data.url; if (data.info) msg = data.info; else msg = L._('Map has been saved!'); this.once('saved', function () {