diff options
| author | Stephen Blott | 2015-05-29 14:20:19 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-05-29 14:22:31 +0100 | 
| commit | 6a97f4cf5e1f1c21336d2fce9da20c3bc5633d05 (patch) | |
| tree | f8351ad881a1e90b27a0cbeaa4d5391c80c6b5a1 | |
| parent | 087f7e8d180c9048ee32bdb243eabe2c15021fc7 (diff) | |
| download | vimium-6a97f4cf5e1f1c21336d2fce9da20c3bc5633d05.tar.bz2 | |
Prepopulate @customSearchMode in vomnibar.
This avoids a flicker whereby the keyword is first inserted into the
input, then removed.
| -rw-r--r-- | content_scripts/vomnibar.coffee | 2 | ||||
| -rw-r--r-- | pages/vomnibar.coffee | 3 | 
2 files changed, 4 insertions, 1 deletions
| diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 76698634..d46b2daf 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -8,7 +8,7 @@ Vomnibar =      extras = {}      for extra in registryEntry.extras        [ key, value ] = extra.split "=" -      extras.query = "#{value} " if key? and key == "keyword" and value? and 0 < value.length +      extras.keyword = value if key? and key == "keyword" and value? and 0 < value.length      extras    # sourceFrameId here (and below) is the ID of the frame from which this request originates, which may be different diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 71f22900..d5659fdc 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -17,6 +17,7 @@ Vomnibar =        query: ""        newTab: false        selectFirst: false +      keyword: null      extend options, userOptions      extend options, refreshInterval: if options.completer == "omni" then 150 else 0 @@ -28,6 +29,7 @@ Vomnibar =      @vomnibarUI.setRefreshInterval options.refreshInterval      @vomnibarUI.setForceNewTab options.newTab      @vomnibarUI.setQuery options.query +    @vomnibarUI.setKeyword options.keyword      @vomnibarUI.update true    hide: -> @vomnibarUI?.hide() @@ -40,6 +42,7 @@ class VomnibarUI      @initDom()    setQuery: (query) -> @input.value = query +  setKeyword: (keyword) -> @customSearchMode = keyword    setInitialSelectionValue: (@initialSelectionValue) ->    setRefreshInterval: (@refreshInterval) ->    setForceNewTab: (@forceNewTab) -> | 
