From 44bae50c85c3680a225e68d02fc82cc94c98a221 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 15 Mar 2024 11:35:42 +0100 Subject: [PATCH] chore: remove remaining openPanel/closePanel calls --- umap/static/umap/js/umap.controls.js | 7 ++----- umap/static/umap/js/umap.js | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) 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 () {