prettified kb menu

This commit is contained in:
Matthew Kastor 2013-03-31 20:47:38 -04:00 committed by nightwing
commit 4ec0a6e706

View file

@ -33,13 +33,12 @@ define(function(require, exports, module) {
module.exports = function showKeyboardShortcuts (editor) {
var kb = getEditorKeybordShortcuts(editor);
var el = document.createElement('div');
el.innerHTML = '<h1 style="padding-top:0; margin-top:0;">' +
'Keyboard Shortcuts</h1><div>' +
JSON.stringify(kb, null, ' ') +
'</div>';
el.style.cssText = 'margin:0; padding:0; ' +
'background-color:white; color:black; ' +
'white-space: pre-wrap;';
var commands = kb.reduce(function (previous, current) {
return previous + '<div><b>' + current.command + '</b> : ' +
current.key + '</div>';
}, '');
el.innerHTML = '<h1>Keyboard Shortcuts</h1>' + commands;
el.style.cssText = 'margin:0; padding:0;';
overlayPage(el, '0', '0', '0', null);
};
});