Full text edit button

This commit is contained in:
Yohan Boniface 2023-07-25 11:19:00 +02:00
parent 10b1e0bb0a
commit ccac42d25a
2 changed files with 20 additions and 3 deletions

View file

@ -316,11 +316,12 @@ L.U.EditControl = L.Control.extend({
onAdd: function (map) { onAdd: function (map) {
const container = L.DomUtil.create( const container = L.DomUtil.create(
'div', 'div',
'leaflet-control-edit-enable umap-control' 'leaflet-control-edit-enable',
), ),
edit = L.DomUtil.create('a', '', container) edit = L.DomUtil.create('a', '', container)
edit.href = '#' edit.href = '#'
edit.title = `${L._('Enable editing')} (Ctrl+E)` edit.title = `${L._('Enable editing')} (Ctrl+E)`
edit.textContent = L._('Edit')
L.DomEvent.addListener(edit, 'click', L.DomEvent.stop).addListener( L.DomEvent.addListener(edit, 'click', L.DomEvent.stop).addListener(
edit, edit,

View file

@ -116,9 +116,26 @@ a.umap-control-less {
height: 23px; height: 23px;
line-height: 23px; line-height: 23px;
} }
.leaflet-control-edit-enable a:before {
content: ' ';
width: 24px;
height: 24px;
display: inline-block;
vertical-align: middle;
background-image: url('./img/16-white.svg');
background-position: -52px -49px;
}
.leaflet-control-edit-enable a { .leaflet-control-edit-enable a {
background-position: 0 0; width: initial;
padding: 0 20px;
background-color: #353c3e; background-color: #353c3e;
color: #fff;
background-image: none;
border-radius: 20px;
height: 36px;
line-height: 36px;
display: block;
} }
.leaflet-control-toolbar .leaflet-toolbar-icon.dark:hover, .leaflet-control-toolbar .leaflet-toolbar-icon.dark:hover,
.leaflet-control-edit-enable a:hover { .leaflet-control-edit-enable a:hover {
@ -203,7 +220,6 @@ ul.photon-autocomplete {
background-image: url('./img/24.svg'); background-image: url('./img/24.svg');
background-size: auto auto; background-size: auto auto;
} }
.leaflet-control-edit-enable a,
.leaflet-control-toolbar li .leaflet-toolbar-icon.dark { .leaflet-control-toolbar li .leaflet-toolbar-icon.dark {
background-image: url('./img/24-white.svg'); background-image: url('./img/24-white.svg');
} }