From 8d51ccbb01fe2a4e7b548cc14617a05048a8d68c Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 10 May 2015 07:25:20 +0100 Subject: Search completion; more minor tweaks. --- pages/vomnibar.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 4dd05cd4..2077c559 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -218,16 +218,17 @@ class VomnibarUI @updateSelection() else if (action == "enter") if @selection == -1 + # The user has not selected a suggestion. query = @input.value.trim() # on an empty vomnibar is a no-op. return unless 0 < query.length if @suppressedLeadingKeyword? - # This is a custom search engine completion. Because of the way we add the text common to all - # completions to the input (highlighted), the text in the input might not correspond to any of the - # completions. So we fire the query off to the background page and use the completion at the top of - # the list (which will be the right one). + # This is a custom search engine completion. Because of the way we add and highlight the text + # common to all completions in the input (highlightCommonMatches), the text in the input might not + # correspond to any of the completions. So we fire the query off to the background page and use the + # completion at the top of the list (which will be the right one). @update true, => - if @completions[0]? + if @completions[0] completion = @completions[0] @hide -> completion.performAction openInNewTab else -- cgit v1.2.3