aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-09-02 13:47:14 +0100
committerStephen Blott2014-09-02 14:02:44 +0100
commit76150e7b982b5cc6b68ad0dcf36c70382fdea30d (patch)
tree522ba9baa047dc52ae0a25dbd82af48f93be0543 /background_scripts/main.coffee
parentf2596ae0eaaa09a1ec5d641f048d7472f19c812b (diff)
downloadvimium-76150e7b982b5cc6b68ad0dcf36c70382fdea30d.tar.bz2
Structured exclusion rules: Fix typos and minor issues.
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 4111ac06..47b215e5 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -74,9 +74,9 @@ getCurrentTabUrl = (request, sender) -> sender.tab.url
#
root.isEnabledForUrl = isEnabledForUrl = (request) ->
rule = Exclusions.getRule(request.url)
- return { rule: rule, isEnabledForUrl: true, passKeys: rule.passKeys } if rule and rule.passKeys
- return { rule: rule, isEnabledForUrl: false, passKeys: "" } if rule
- return { rule: rule, isEnabledForUrl: true, passKeys: "" }
+ newIsEnabled = !rule or rule.passKeys
+ newPassKeys = if newIsEnabled and rule then rule.passKeys else ""
+ { rule: rule, isEnabledForUrl: newIsEnabled, passKeys: newPassKeys }
# Called by the popup UI. If an existing exclusion rule has been changed, then the existing rule is updated.
# Otherwise, the new rule is added.