aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-12-11 14:57:32 +0000
committerStephen Blott2016-12-11 14:57:32 +0000
commit96fcc551188a548c565103285701aed9622e5a99 (patch)
treed4e4e631117bc775dba7953785eefe230797ba25
parentcc09af6921228033b822ef4ad4713abd26c375e7 (diff)
downloadvimium-96fcc551188a548c565103285701aed9622e5a99.tar.bz2
Remove Utils.nextTick() to fix tests.
-rw-r--r--background_scripts/commands.coffee30
1 files changed, 14 insertions, 16 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index f5a3840b..3684304c 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -114,23 +114,21 @@ Commands =
delete currentMapping[key][prop] for prop in ["keySequence", "description"]
chrome.storage.local.set normalModeKeyStateMapping: keyStateMapping
- # Build the "helpPageData" data structure which the help page needs and place it in Chrome storage. We do
- # this on the "nextTick" because there's not need for it to be done synchronously.
+ # Build the "helpPageData" data structure which the help page needs and place it in Chrome storage.
prepareHelpPageData: ->
- Utils.nextTick =>
- commandToKey = {}
- for own key, registryEntry of @keyToCommandRegistry
- (commandToKey[registryEntry.command] ?= []).push key
- commandGroups = {}
- for own group, commands of @commandGroups
- commandGroups[group] = []
- for command in commands
- commandGroups[group].push
- command: command
- description: @availableCommands[command].description
- keys: commandToKey[command] ? []
- advanced: command in @advancedCommands
- chrome.storage.local.set helpPageData: commandGroups
+ commandToKey = {}
+ for own key, registryEntry of @keyToCommandRegistry
+ (commandToKey[registryEntry.command] ?= []).push key
+ commandGroups = {}
+ for own group, commands of @commandGroups
+ commandGroups[group] = []
+ for command in commands
+ commandGroups[group].push
+ command: command
+ description: @availableCommands[command].description
+ keys: commandToKey[command] ? []
+ advanced: command in @advancedCommands
+ chrome.storage.local.set helpPageData: commandGroups
# An ordered listing of all available commands, grouped by type. This is the order they will
# be shown in the help page.