Add parenthesis around keyboard when there is no kbd tag
This happens in title attributes, for example.
This commit is contained in:
parent
2f89a76e08
commit
7f5960d1c4
1 changed files with 5 additions and 2 deletions
|
@ -484,11 +484,14 @@ L.U.Help = L.Class.extend({
|
|||
|
||||
displayLabel: function (action, withKbdTag=true) {
|
||||
let {shortcut, label} = this.SHORTCUTS[action]
|
||||
const modifier = this.isMacOS ? 'Cmd' : 'Ctrl'
|
||||
shortcut = shortcut.replace('Modifier', modifier)
|
||||
if (withKbdTag) {
|
||||
shortcut = shortcut.split('+').map((el) => `<kbd>${el}</kbd>`).join('+')
|
||||
label += ` ${shortcut}`
|
||||
} else {
|
||||
label += ` (${shortcut})`
|
||||
}
|
||||
const modifier = this.isMacOS ? 'Cmd' : 'Ctrl'
|
||||
label += ` ${shortcut.replace('Modifier', modifier)}`
|
||||
return label
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue