mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 00:07:03 +02:00
2.x: Use keyboard styling for shortcuts in tooltips (re: #6574, re: a579e35fcc51d76f55eca16c7524d95c59b66c26)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { t } from '../util/locale';
|
||||
|
||||
|
||||
export function uiTooltipHtml(text, key, heading) {
|
||||
export function uiTooltipHtml(text, keys, heading) {
|
||||
var s = '';
|
||||
|
||||
if (heading) {
|
||||
@@ -10,9 +10,13 @@ export function uiTooltipHtml(text, key, heading) {
|
||||
if (text) {
|
||||
s += '<div class="tooltip-text"><span>' + text + '</span></div>';
|
||||
}
|
||||
if (key) {
|
||||
s += '<div class="keyhint-wrap"><span>' + t('tooltip_keyhint') + '</span>' +
|
||||
'<span class="keyhint">' + key + '</span></div>';
|
||||
if (keys) {
|
||||
if (!Array.isArray(keys)) keys = [keys];
|
||||
s += '<div class="keyhint-wrap"><span>' + t('tooltip_keyhint') + '</span>';
|
||||
keys.forEach(function(key) {
|
||||
s += '<kbd class="shortcut">' + key + '</kbd>';
|
||||
});
|
||||
s += '</div>';
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
Reference in New Issue
Block a user