Commit ef48dd01 authored by Phil Hughes's avatar Phil Hughes Committed by Jacob Schatz

Checks based on whether data is loaded not undefined

parent 4456b41b
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
window.GitLab ?= {} window.GitLab ?= {}
GitLab.GfmAutoComplete = GitLab.GfmAutoComplete =
dataLoading: false dataLoading: false
dataLoaded: false
dataSource: '' dataSource: ''
...@@ -35,7 +36,7 @@ GitLab.GfmAutoComplete = ...@@ -35,7 +36,7 @@ GitLab.GfmAutoComplete =
$.fn.atwho.default.callbacks.filter(query, data, searchKey) $.fn.atwho.default.callbacks.filter(query, data, searchKey)
beforeInsert: (value) -> beforeInsert: (value) ->
if value.indexOf('undefined') is 1 if not GitLab.GfmAutoComplete.dataLoaded
@at @at
else else
value value
...@@ -182,6 +183,8 @@ GitLab.GfmAutoComplete = ...@@ -182,6 +183,8 @@ GitLab.GfmAutoComplete =
$.getJSON(dataSource) $.getJSON(dataSource)
loadData: (data) -> loadData: (data) ->
@dataLoaded = true
# load members # load members
@input.atwho 'load', '@', data.members @input.atwho 'load', '@', data.members
# load issues # load issues
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment