From ae3794d10f11f61d7d78c523afc3abc4d5f72467 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 21 Dec 2014 07:19:37 +0000 Subject: Exclusion; focus last rule. --- pages/options.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/options.coffee b/pages/options.coffee index 1cd0661f..c3f619ca 100644 --- a/pages/options.coffee +++ b/pages/options.coffee @@ -107,14 +107,15 @@ class ExclusionRulesOption extends Option for rule in rules @appendRule rule - # If this is the popup page (@url is defined), then hide rules which do not match @url. If no rules - # match, then add a default rule. + # If this is the popup page (@url is truthy), then hide rules which do not match @url. If no rules + # match, then add a default rule. Focus the passKeys field in the last (most recent) rule. if @url haveMatch = false for element in @element.getElementsByClassName "exclusionRuleTemplateInstance" pattern = element.children[0].firstChild.value.trim() if @url.match bgExclusions.RegexpCache.get pattern haveMatch = true + element.children[1].firstChild.focus() else element.style.display = 'none' @addRule() unless haveMatch -- cgit v1.2.3