aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorPhil Crosby2012-05-29 16:36:05 -0700
committerPhil Crosby2012-05-29 16:36:05 -0700
commit4f7d314135793bf315304d2663df2144441dc33a (patch)
treed8a18d854f20e475bebadfa854186741524c2b72 /content_scripts
parentaf17e5c0fc703ab31f855859f429158cde666131 (diff)
downloadvimium-4f7d314135793bf315304d2663df2144441dc33a.tar.bz2
Have Function.curry take varargs instead of an array.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vomnibar.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/content_scripts/vomnibar.js b/content_scripts/vomnibar.js
index 97f8b1c1..3fedc8c4 100644
--- a/content_scripts/vomnibar.js
+++ b/content_scripts/vomnibar.js
@@ -195,11 +195,15 @@ var vomnibar = (function() {
this.filterPort.onMessage.addListener(function(msg) {
if (msg.id != id) return;
// The result objects coming from the background page will be of the form:
- // { html: "", action: { functionName: "", args: [] } }
- // functionName will be either "navigateToUrl" or "switchToTab". args will be a URL or a tab ID.
+ // { html: "", action: "", url: "" }
+ // action will be either "navigateToUrl" or "switchToTab".
var results = msg.results.map(function(result) {
- var functionToCall = completionActions[result.action.functionName];
- result.performAction = functionToCall.curry(result.action.args);
+ var functionToCall = completionActions[result.action];
+ if (result.action == "navigateToUrl")
+ functionToCall = functionToCall.curry(result.url);
+ else if (result.action == "switchToTab")
+ functionToCall = functionToCall.curry(result.tabId);
+ result.performAction = functionToCall;
return result;
});
callback(results);