   selectResult: (e, model) ->
     return false unless model and model.get('published')
     analytics.track.click 'Selected item from search',
-      query : @query
-      label : analytics.modelNameAndIdToLabel model.get('display_model'), model.id
+      query: @query
+      label: analytics.modelNameAndIdToLabel model.get('display_model'), model.id
     @selected = true
     window.location = model.get 'location'
 

_           = require 'underscore'
Backbone    = require 'backbone'
sd          = require('sharify').data
Search      = require './collections/search.coffee'
mediator    = require '../../lib/mediator.coffee'
analytics   = require '../../lib/analytics.coffee'
{ fill }    = require '../../lib/resizer.coffee'

itemTemplate = -> require('./templates/item.jade') arguments...

module.exports = class SearchBarView extends Backbone.View

    throw new Error('Requires an input field') unless @$input?

    @search = new Search
      restrictType: @restrictType
      mode: @mode
      fairId: @fairId

    @on 'search:start', @indicateLoading
    @on 'search:complete', @concealLoading
    @on 'search:opened', @displaySuggestions
    @on 'search:closed', @hideSuggestions

    @setupTypeahead()

  events:
    'keyup input': 'checkSubmission'
    'focus input': 'trackFocusInput'

  trackFocusInput: ->
    analytics.track.click "Focused on search input"
