From 63d4a74c54b6a70e8399aebc51c759f80b9866af Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 6 Feb 2015 06:37:12 +0000 Subject: Fix search-engine auto selection. In #1389/c52c0ea57f86c1c5a132819fe85e763db84ce712 we added descriptions to search engines. We (I) omitted to realise that the "type" of a selection (in particular, the constant "search") is also used to determine whether the suggestion is automatically selected by the vomnibar. This fixes that, such that custom search engines with descriptions are now automatically selected in the vomnibar. --- background_scripts/completion.coffee | 3 +++ 1 file changed, 3 insertions(+) (limited to 'background_scripts/completion.coffee') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index d6402019..177892fb 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -21,6 +21,8 @@ class Suggestion # - extraRelevancyData: data (like the History item itself) which may be used by the relevancy function. constructor: (@queryTerms, @type, @url, @title, @computeRelevancyFunction, @extraRelevancyData) -> @title ||= "" + # When @autoSelect is truthy, the suggestion is automatically pre-selected in the vomnibar. + @autoSelect = false computeRelevancy: -> @relevancy = @computeRelevancyFunction(this) @@ -335,6 +337,7 @@ class SearchEngineCompleter type = "search" query = queryTerms[0] + ": " + queryTerms[1..].join(" ") suggestion = new Suggestion(queryTerms, type, url, query, @computeRelevancy) + suggestion.autoSelect = true suggestions.push(suggestion) onComplete(suggestions) -- cgit v1.2.3