debian-mirror-gitlab/app/assets/javascripts/search_autocomplete.js.coffee

12 lines
408 B
CoffeeScript
Raw Normal View History

2015-04-26 12:48:37 +05:30
class @SearchAutocomplete
2014-09-02 18:07:02 +05:30
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
$("#search").autocomplete
source: search_autocomplete_path + query
minLength: 1
select: (event, ui) ->
location.href = ui.item.url