diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 45ce42e3..e1710f3e 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -598,7 +598,7 @@ U.DataLayer.include({ if (!this.isVisible()) return if (!confirm(L._('Are you sure you want to delete this layer?'))) return this._delete() - this.map.ui.closePanel() + this.map.editPanel.close() }, this ) @@ -898,10 +898,7 @@ const ControlsMixin = { 'leaflet-control-edit-disable', rightContainer, L.DomUtil.add('span', '', null, L._('View')), - function (e) { - this.disableEdit(e) - this.ui.closePanel() - }, + this.disableEdit, this ) L.DomEvent.on( diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 5b3e663b..0ff863d5 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -541,7 +541,6 @@ U.Map = L.Map.extend({ } else if (key === U.Keys.E && modifierKey && this.editEnabled && !this.isDirty) { L.DomEvent.stop(e) this.disableEdit() - this.ui.closePanel() } if (key === U.Keys.S && modifierKey) { L.DomEvent.stop(e) @@ -1571,6 +1570,8 @@ U.Map = L.Map.extend({ this.editedFeature = null this.editEnabled = false this.fire('edit:disabled') + this.editPanel.close() + this.fullPanel.close() }, hasEditMode: function () {