Chromium Code Reviews| Index: ui/webui/resources/js/cr/ui/menu_item.js |
| diff --git a/ui/webui/resources/js/cr/ui/menu_item.js b/ui/webui/resources/js/cr/ui/menu_item.js |
| index b4726f282f9d03f47265db2ea55967b13c489e00..bfe7eaac1f5903bb3da92ce4bf172ebac160d306 100644 |
| --- a/ui/webui/resources/js/cr/ui/menu_item.js |
| +++ b/ui/webui/resources/js/cr/ui/menu_item.js |
| @@ -143,7 +143,7 @@ cr.define('cr.ui', function() { |
| var shortcut = shortcuts[0]; |
| var mods = {}; |
| var ident = ''; |
| - shortcut.split('-').forEach(function(part) { |
| + shortcut.split('|').forEach(function(part) { |
| var partUc = part.toUpperCase(); |
| switch (partUc) { |
| case 'CTRL': |
| @@ -160,25 +160,19 @@ cr.define('cr.ui', function() { |
| var shortcutText = ''; |
| - // TODO(zvorygin): if more cornercases appear - optimize following |
| - // code. Currently 'Enter' keystroke is passed as 'Enter', but 'Space' |
| - // and 'Backspace' are passed as 'U+0020' and 'U+0008'. |
| - if (ident == 'U+0020') |
| - ident = 'Space'; |
| - else if (ident == 'U+0008') |
| - ident = 'Backspace'; |
| - |
| ['CTRL', 'ALT', 'SHIFT', 'META'].forEach(function(mod) { |
| if (mods[mod]) |
| shortcutText += loadTimeData.getString('SHORTCUT_' + mod) + '+'; |
| }); |
| - if (ident.indexOf('U+') != 0) { |
| + if (ident == ' ') |
| + ident = 'Space'; |
| + |
| + if (ident.length != 1) { |
|
Dan Beam
2016/06/29 23:34:17
what's going on here?
dtapuska
2016/06/30 14:16:50
So previously it would check if started with index
|
| shortcutText += |
| loadTimeData.getString('SHORTCUT_' + ident.toUpperCase()); |
| } else { |
| - shortcutText += |
| - String.fromCharCode(parseInt(ident.substring(2), 16)); |
| + shortcutText += ident.toUpperCase(); |
| } |
| this.setAttribute('shortcutText', shortcutText); |