Better labels and icons for edit/preview modes

Fix #556
This commit is contained in:
David Larlet 2023-10-27 11:31:34 -04:00
parent 2f424b7539
commit 1d65ce6b49
No known key found for this signature in database
GPG key ID: 3E2953A359E7E7BD
2 changed files with 7 additions and 7 deletions

View file

@ -323,7 +323,7 @@ L.U.EditControl = L.Control.extend({
const enableEditing = L.DomUtil.createButton( const enableEditing = L.DomUtil.createButton(
'', '',
container, container,
L._('Enable editing'), L._('Edit'),
map.enableEdit, map.enableEdit,
map map
) )
@ -332,7 +332,7 @@ L.U.EditControl = L.Control.extend({
'mouseover', 'mouseover',
function () { function () {
map.ui.tooltip({ map.ui.tooltip({
content: `${L._('Edit map')} (<kbd>Ctrl+E</kbd>)`, content: `${L._('Switch to edit mode')} (<kbd>Ctrl+E</kbd>)`,
anchor: enableEditing, anchor: enableEditing,
position: 'bottom', position: 'bottom',
delay: 750, delay: 750,
@ -977,7 +977,7 @@ L.U.Map.include({
const controlEditDisable = L.DomUtil.createButton( const controlEditDisable = L.DomUtil.createButton(
'leaflet-control-edit-disable', 'leaflet-control-edit-disable',
rightContainer, rightContainer,
L.DomUtil.add('span', '', null, L._('Disable editing')), L.DomUtil.add('span', '', null, L._('View')),
function (e) { function (e) {
this.disableEdit(e) this.disableEdit(e)
this.ui.closePanel() this.ui.closePanel()
@ -989,7 +989,7 @@ L.U.Map.include({
'mouseover', 'mouseover',
function () { function () {
this.ui.tooltip({ this.ui.tooltip({
content: `${L._('Disable editing')} (<kbd>Ctrl+E</kbd>)`, content: `${L._('Back to preview')} (<kbd>Ctrl+E</kbd>)`,
anchor: controlEditDisable, anchor: controlEditDisable,
position: 'bottom', position: 'bottom',
delay: 500, delay: 500,
@ -1001,7 +1001,7 @@ L.U.Map.include({
const controlEditSave = L.DomUtil.createButton( const controlEditSave = L.DomUtil.createButton(
'leaflet-control-edit-save button', 'leaflet-control-edit-save button',
rightContainer, rightContainer,
L.DomUtil.add('span', '', null, L._('Save current edits')), L.DomUtil.add('span', '', null, L._('Save')),
this.save, this.save,
this this
) )
@ -1010,7 +1010,7 @@ L.U.Map.include({
'mouseover', 'mouseover',
function () { function () {
this.ui.tooltip({ this.ui.tooltip({
content: `${L._('Save')} (<kbd>Ctrl+S</kbd>)`, content: `${L._('Save current edits')} (<kbd>Ctrl+S</kbd>)`,
anchor: controlEditSave, anchor: controlEditSave,
position: 'bottom', position: 'bottom',
delay: 500, delay: 500,

View file

@ -463,7 +463,7 @@ ul.photon-autocomplete {
background-position: -2px -25px; background-position: -2px -25px;
} }
.leaflet-container .leaflet-control-edit-disable:before { .leaflet-container .leaflet-control-edit-disable:before {
background-position: -26px -1px; background-position: -52px -25px;
} }
.leaflet-container .leaflet-control-edit-cancel, .leaflet-container .leaflet-control-edit-cancel,
.leaflet-container .leaflet-control-edit-disable { .leaflet-container .leaflet-control-edit-disable {