Improve tooltip design

This commit is contained in:
jdescottes
2014-07-09 07:56:22 +02:00
parent b311312260
commit a6d70920e2
11 changed files with 111 additions and 23 deletions

View File

@ -136,7 +136,12 @@
};
ns.ToolController.prototype.getTooltipText_ = function (tool) {
return tool.instance.helpText + ' (' + tool.shortcut + ')';
var shortcutMarkup = "<span class='tools-tooltip-shortcut'>("+tool.shortcut+")</span>";
if (tool.instance.helpText.indexOf('{{shortcut}}') !== -1) {
return tool.instance.helpText.replace('{{shortcut}}', shortcutMarkup);
} else {
return tool.instance.helpText + ' ' + shortcutMarkup;
}
};
ns.ToolController.prototype.addKeyboardShortcuts_ = function () {