From 32895a96b3da225bd1b46d4b96ab98fd71755281 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 5 May 2015 16:16:59 +0100 Subject: Search completion; changes in response to @mrmr1993. --- background_scripts/completion.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'background_scripts/completion.coffee') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 92936098..39f8a140 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -34,17 +34,15 @@ class Suggestion generateHtml: -> return @html if @html relevancyHtml = if @showRelevancy then "#{@computeRelevancy()}" else "" - highlightTerms = - if @noHighlightTerms then ((s) -> Utils.escapeHtml s) else ((s) => @highlightTerms Utils.escapeHtml s) # NOTE(philc): We're using these vimium-specific class names so we don't collide with the page's CSS. @html = """
""" @@ -85,6 +83,7 @@ class Suggestion # Wraps each occurence of the query terms in the given string in a . highlightTerms: (string) -> + return string if @noHighlightTerms ranges = [] escapedTerms = @queryTerms.map (term) -> Utils.escapeHtml(term) for term in escapedTerms @@ -399,6 +398,7 @@ class SearchEngineCompleter count = Math.min 6, Math.max 3, MultiCompleter.maxResults - existingSuggestions.length onComplete suggestions[...count] + # FIXME(smblott) Refactor Suggestion constructor as per @mrmr1993's comment in #1635. mkSuggestion: (insertText, args...) -> suggestion = new Suggestion args... extend suggestion, insertText: insertText, noHighlightTerms: true -- cgit v1.2.3