From 2dd745886ecdadb2ba6a5dbb38e3857211765378 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sat, 7 Jul 2012 05:23:15 -0700 Subject: Make Vomnibar tabbing scroll circularly. --- content_scripts/vomnibar.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 146a8aa8..e60d6e52 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -92,10 +92,12 @@ class VomnibarUI if (action == "dismiss") @hide() else if (action == "up") - @selection -=1 if @selection >= 0 + @selection -= 1 + @selection = @completions.length - 1 if @selection < -1 @updateSelection() else if (action == "down") - @selection += 1 if (@selection < @completions.length - 1) + @selection += 1 + @selection = -1 if @selection == @completions.length @updateSelection() else if (action == "enter") # If they type something and hit enter without selecting a completion from our list of suggestions, -- cgit v1.2.3