aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-04-19 07:22:17 +0100
committerStephen Blott2016-04-22 14:52:45 +0100
commit3adae8c9a683955641fe1417c977a3a06356107b (patch)
tree45b074ee27f7c8dd7c9ee4ac8413f28e44b9afd6 /background_scripts/main.coffee
parentcfad0ded611149b2757baa19fbac587a7d4f210d (diff)
downloadvimium-3adae8c9a683955641fe1417c977a3a06356107b.tar.bz2
Help dialog: put keys in greyed-out box.
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee11
1 files changed, 6 insertions, 5 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 272146cb..9689dd79 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -106,11 +106,12 @@ helpDialogHtmlForCommandGroup = (group, commandsToKey, availableCommands,
showUnboundCommands, showCommandNames) ->
html = []
for command in Commands.commandGroups[group]
- bindings = (commandsToKey[command] || [""]).join(", ")
+ keys = commandsToKey[command] || []
+ bindings = ("<span class='vimiumHelpDialogKey'>#{Utils.escapeHtml key}</span>" for key in keys).join ", "
if (showUnboundCommands || commandsToKey[command])
isAdvanced = Commands.advancedCommands.indexOf(command) >= 0
description = availableCommands[command].description
- if bindings.length < 12
+ if keys.join(", ").length < 12
helpDialogHtmlForCommand html, isAdvanced, bindings, description, showCommandNames, command
else
# If the length of the bindings is too long, then we display the bindings on a separate row from the
@@ -122,11 +123,11 @@ helpDialogHtmlForCommandGroup = (group, commandsToKey, availableCommands,
helpDialogHtmlForCommand = (html, isAdvanced, bindings, description, showCommandNames, command) ->
html.push "<tr class='vimiumReset #{"advanced" if isAdvanced}'>"
if description
- html.push "<td class='vimiumReset'>", Utils.escapeHtml(bindings), "</td>"
- html.push "<td class='vimiumReset'>#{if description and bindings then ':' else ''}</td><td class='vimiumReset vimiumHelpDescription'>", description
+ html.push "<td class='vimiumReset'>#{bindings}</td>"
+ html.push "<td class='vimiumReset'></td><td class='vimiumReset vimiumHelpDescription'>", description
html.push("<span class='vimiumReset commandName'>(#{command})</span>") if showCommandNames
else
- html.push "<td class='vimiumReset' colspan='3' style='text-align: left;'>", Utils.escapeHtml(bindings)
+ html.push "<td class='vimiumReset' colspan='3' style='text-align: left;'>", bindings
html.push("</td></tr>")
# Cache "content_scripts/vimium.css" in chrome.storage.local for UI components.