diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 1584e6a4..41cdbaa9 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -245,8 +245,6 @@ U.Map = L.Map.extend({ this.initContextMenu() this.on('click contextmenu.show', this.closeInplaceToolbar) this.sync = new U.SyncEngine(this) - - this.initSyncEngine() }, initSyncEngine: async function () { @@ -1599,6 +1597,7 @@ U.Map = L.Map.extend({ this.editEnabled = true this.drop.enable() this.fire('edit:enabled') + this.initSyncEngine() }, disableEdit: function () { @@ -1610,6 +1609,7 @@ U.Map = L.Map.extend({ this.fire('edit:disabled') this.editPanel.close() this.fullPanel.close() + this.sync.stop() }, hasEditMode: function () {