diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 97a6665b..2c67911c 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -1003,11 +1003,13 @@ L.U.Map.include({ } update() this.once('saved', L.bind(update, this)) - name.href = '#' - share_status.href = '#' logo.href = '/' - L.DomEvent.on(name, 'click', this.edit, this) - L.DomEvent.on(share_status, 'click', this.permissions.edit, this.permissions) + if (this.options.editMode === 'advanced') { + name.href = '#' + share_status.href = '#' + L.DomEvent.on(name, 'click', this.edit, this) + L.DomEvent.on(share_status, 'click', this.permissions.edit, this.permissions) + } this.on('postsync', L.bind(update, this)) const save = L.DomUtil.create('a', 'leaflet-control-edit-save button', container) save.href = '#' diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index df1b0c16..6883c025 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1749,6 +1749,7 @@ L.U.Map.include({ edit: function () { if (!this.editEnabled) return + if (this.options.editMode !== 'advanced') return const container = L.DomUtil.create('div', 'umap-edit-container'), metadataFields = ['options.name', 'options.description'], title = L.DomUtil.create('h3', '', container) diff --git a/umap/static/umap/js/umap.permissions.js b/umap/static/umap/js/umap.permissions.js index 45321db4..f3cfbfa5 100644 --- a/umap/static/umap/js/umap.permissions.js +++ b/umap/static/umap/js/umap.permissions.js @@ -51,6 +51,7 @@ L.U.MapPermissions = L.Class.extend({ }, edit: function () { + if (this.map.options.editMode !== 'advanced') return if (!this.map.options.umap_id) return this.map.ui.alert({ content: L._('Please save the map first'),