mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
feat(sync): Only sync when on edit mode
The is done to save server resources, for accessed maps which aren't currently being edited.
This commit is contained in:
parent
66eb90ffd1
commit
c6ee25b906
1 changed files with 2 additions and 2 deletions
|
@ -249,8 +249,6 @@ U.Map = L.Map.extend({
|
||||||
this.initContextMenu()
|
this.initContextMenu()
|
||||||
this.on('click contextmenu.show', this.closeInplaceToolbar)
|
this.on('click contextmenu.show', this.closeInplaceToolbar)
|
||||||
this.sync = new U.SyncEngine(this)
|
this.sync = new U.SyncEngine(this)
|
||||||
|
|
||||||
this.initSyncEngine()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initSyncEngine: async function () {
|
initSyncEngine: async function () {
|
||||||
|
@ -1602,6 +1600,7 @@ U.Map = L.Map.extend({
|
||||||
this.editEnabled = true
|
this.editEnabled = true
|
||||||
this.drop.enable()
|
this.drop.enable()
|
||||||
this.fire('edit:enabled')
|
this.fire('edit:enabled')
|
||||||
|
this.initSyncEngine()
|
||||||
},
|
},
|
||||||
|
|
||||||
disableEdit: function () {
|
disableEdit: function () {
|
||||||
|
@ -1613,6 +1612,7 @@ U.Map = L.Map.extend({
|
||||||
this.fire('edit:disabled')
|
this.fire('edit:disabled')
|
||||||
this.editPanel.close()
|
this.editPanel.close()
|
||||||
this.fullPanel.close()
|
this.fullPanel.close()
|
||||||
|
this.sync.stop()
|
||||||
},
|
},
|
||||||
|
|
||||||
hasEditMode: function () {
|
hasEditMode: function () {
|
||||||
|
|
Loading…
Reference in a new issue