This commit is contained in:
Yohan Boniface 2023-11-27 21:45:24 +01:00
parent 445ce7b6ba
commit 9c71d74ec9

View file

@ -434,6 +434,16 @@ L.U.Keys = {
}
L.U.Help = L.Class.extend({
SHORTCUTS: {
'Ctrl+M': L._('Draw a marker'),
'Ctrl+L': L._('Draw a polyline'),
'Ctrl+P': L._('Draw a polygon'),
'Ctrl+E': L._('Toggle edit mode'),
'Ctrl+S': L._('Save map'),
'Ctrl+I': L._('Open import panel'),
},
initialize: function (map) {
this.map = map
this.box = L.DomUtil.create(
@ -525,6 +535,10 @@ L.U.Help = L.Class.extend({
for (const id in this.map.helpMenuActions) {
addAction(this.map.helpMenuActions[id])
}
const kbdList = L.DomUtil.create('div', 'kbd-list', container)
for (const [kbd, label] of Object.entries(this.SHORTCUTS)) {
L.DomUtil.add('span', '', kbdList, `<kbd>${kbd}</kbd> ${label}`)
}
return container
},