diff options
| author | Jez Ng | 2012-10-28 05:08:42 -0400 |
|---|---|---|
| committer | Jez Ng | 2012-10-28 05:08:42 -0400 |
| commit | bfc4104609cdd2252e11ca71ca9d77f66e897527 (patch) | |
| tree | a2037bcc5d33f9062dc51b919e3345e30087e112 | |
| parent | 43629ef44e6d9c59ffea46e0a59828fa8dc8b3d6 (diff) | |
| download | vimium-bfc4104609cdd2252e11ca71ca9d77f66e897527.tar.bz2 | |
Ensure the initial selection index is always respected.
Closes #687.
| -rw-r--r-- | content_scripts/vomnibar.coffee | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 724f4874..31e58f15 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -68,7 +68,6 @@ class VomnibarUI @update(true) updateSelection: -> - @selection = Math.min(@selection, @completions.length - 1) for i in [0...@completionList.children.length] @completionList.children[i].className = (if i == @selection then "vomnibarSelected" else "") @@ -139,6 +138,7 @@ class VomnibarUI # update completion list with the new data @completionList.innerHTML = completions.map((completion) -> "<li>#{completion.html}</li>").join("") @completionList.style.display = if completions.length > 0 then "block" else "none" + @selection = Math.min(Math.max(@initialSelectionValue, @selection), @completions.length - 1) @updateSelection() update: (updateSynchronously, callback) -> |
