aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-04-22 14:20:00 +0100
committerStephen Blott2016-04-22 14:20:00 +0100
commitc279d9ae9a802219e327c88d673a6f891ebc6b28 (patch)
tree48e0ac2ae416a235d01ba6807c1be1d283b47c74 /content_scripts
parentc5198e1b6cc90389e15979fb72cccd314feb73b8 (diff)
parentb809fd8d2245793decb45160455939c3cc7993d8 (diff)
downloadvimium-c279d9ae9a802219e327c88d673a6f891ebc6b28.tar.bz2
Merge pull request #2108 from smblott-github/prime-focus-input-on-options-page
Prime focus input on the Vimium options page.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vimium_frontend.coffee4
1 files changed, 4 insertions, 0 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 06b447fc..d316da4c 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -391,6 +391,10 @@ extend window,
HUD.showForDuration("There are no inputs to focus.", 1000)
return
+ # This is a hack to improve usability on the Vimium options page. We prime the recently-focused input
+ # to be the key-mappings input. Arguably, this is the input that the user is most likely to use.
+ recentlyFocusedElement ?= document.getElementById "keyMappings" if window.isVimiumOptionsPage
+
selectedInputIndex =
if count == 1
# As the starting index, we pick that of the most recently focused input element (or 0).