diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-01-11 11:06:00 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-01-11 11:13:11 +0100 |
commit | 569f5701ee410b3f6da7e005e7277d1add467d44 (patch) | |
tree | 992616841bb1c4d24e7ae96157c887d065a7e9fa /app/assets | |
parent | ce066ba63069cfcc2d29aba896bdfa611efe30bc (diff) | |
download | gitlab-ce-569f5701ee410b3f6da7e005e7277d1add467d44.tar.gz |
Only load autocomplete data when actually needed
Previously this would result in autocomplete data being loaded for every
page (e.g. the page showing all Git branches of a project).
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js.coffee | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js.coffee b/app/assets/javascripts/gfm_auto_complete.js.coffee index fa90fb65f42..4718bcf7a1e 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.coffee +++ b/app/assets/javascripts/gfm_auto_complete.js.coffee @@ -68,12 +68,13 @@ GitLab.GfmAutoComplete = title: sanitize(m.title) search: "#{m.iid} #{m.title}" - $.getJSON(@dataSource).done (data) -> - # load members - input.atwho 'load', '@', data.members - # load issues - input.atwho 'load', 'issues', data.issues - # load merge requests - input.atwho 'load', 'mergerequests', data.mergerequests - # load emojis - input.atwho 'load', ':', data.emojis + if @dataSource + $.getJSON(@dataSource).done (data) -> + # load members + input.atwho 'load', '@', data.members + # load issues + input.atwho 'load', 'issues', data.issues + # load merge requests + input.atwho 'load', 'mergerequests', data.mergerequests + # load emojis + input.atwho 'load', ':', data.emojis |