Merge pull request #1294 from umap-project/help-button-icon

Restore help button icon
This commit is contained in:
Yohan Boniface 2023-09-01 17:24:42 +02:00 committed by GitHub
commit 078bff3f2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View file

@ -1011,7 +1011,7 @@ L.U.Map.include({
disable.href = '#'
disable.textContent = L._('Disable editing')
disable.title = `${disable.textContent} (Ctrl+E)`
this.help.button(container, 'edit')
this.help.link(container, 'edit')
if (this.options.user) {
const userLabel = L.DomUtil.add(
'a',

View file

@ -428,10 +428,9 @@ L.U.Help = L.Class.extend({
return typeof this[name] === 'function' ? this[name]() : this[name]
},
button: function (container, entries) {
const helpButton = L.DomUtil.create('a', 'umap-help-button', container)
button: function (container, entries, classname) {
const helpButton = L.DomUtil.create('a', classname || 'umap-help-button', container)
helpButton.href = '#'
helpButton.textContent = L._("Help")
if (entries) {
L.DomEvent.on(helpButton, 'click', L.DomEvent.stop).on(
helpButton,
@ -446,6 +445,12 @@ L.U.Help = L.Class.extend({
return helpButton
},
link: function (container, entries) {
const helpButton = this.button(container, entries, 'umap-help-link')
helpButton.textContent = L._("Help")
return helpButton
},
edit: function () {
const container = L.DomUtil.create('div', ''),
self = this,

View file

@ -348,6 +348,19 @@ ul.photon-autocomplete {
float: right;
}
.umap-help-button {
display: inline-block;
width: 16px;
height: 16px;
margin-left: 5px;
background-position: -4px -4px;
background-repeat: no-repeat;
background-image: url('./img/16.svg');
vertical-align: middle;
}
.dark .umap-help-button {
background-image: url('./img/16-white.svg');
}
.umap-help-link {
float: right;
margin-right: 20px;
}