Do not make map name and share status label clickable unless user can edit
This commit is contained in:
parent
a04acb828d
commit
157146dc04
3 changed files with 8 additions and 4 deletions
|
@ -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 = '#'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'),
|
||||
|
|
Loading…
Reference in a new issue