From bfc4104609cdd2252e11ca71ca9d77f66e897527 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sun, 28 Oct 2012 05:08:42 -0400 Subject: Ensure the initial selection index is always respected. Closes #687. --- content_scripts/vomnibar.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -> "
  • #{completion.html}
  • ").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) -> -- cgit v1.2.3