BigW Consortium Gitlab

search_autocomplete.js.coffee 408 Bytes
Newer Older
1
class @SearchAutocomplete
2 3 4 5 6
  constructor: (search_autocomplete_path, project_id, project_ref) ->
    project_id = '' unless project_id
    project_ref = '' unless project_ref
    query = "?project_id=" + project_id + "&project_ref=" + project_ref

7
    $("#search").autocomplete
8 9
      source: search_autocomplete_path + query
      minLength: 1
10 11
      select: (event, ui) ->
        location.href = ui.item.url