Change URL at each save in case the map name has changed

fix #555
This commit is contained in:
Yohan Boniface 2018-06-16 22:56:23 +02:00
parent 725e42c597
commit fc9ffdf228

View file

@ -1073,9 +1073,10 @@ L.U.Map.include({
if (!this.options.umap_id) { if (!this.options.umap_id) {
duration = 100000; // we want a longer message at map creation (TODO UGLY) duration = 100000; // we want a longer message at map creation (TODO UGLY)
this.options.umap_id = data.id; this.options.umap_id = data.id;
}
// Update URL in case the name has changed.
if (history && history.pushState) history.pushState({}, this.options.name, data.url); if (history && history.pushState) history.pushState({}, this.options.name, data.url);
else window.location = data.url; else window.location = data.url;
}
if (data.info) msg = data.info; if (data.info) msg = data.info;
else msg = L._('Map has been saved!'); else msg = L._('Map has been saved!');
this.once('saved', function () { this.once('saved', function () {