Commit 57a4319d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'load-autocomplete-when-needed' into 'master'

Only load autocomplete data when actually needed



See merge request !2365
parents b6c2908c 569f5701
...@@ -68,6 +68,7 @@ GitLab.GfmAutoComplete = ...@@ -68,6 +68,7 @@ GitLab.GfmAutoComplete =
title: sanitize(m.title) title: sanitize(m.title)
search: "#{m.iid} #{m.title}" search: "#{m.iid} #{m.title}"
if @dataSource
$.getJSON(@dataSource).done (data) -> $.getJSON(@dataSource).done (data) ->
# load members # load members
input.atwho 'load', '@', data.members input.atwho 'load', '@', data.members
......
- project = @target_project || @project - project = @target_project || @project
:javascript
- if @noteable
:javascript
GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: @noteable.class, type_id: params[:id])}" GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: @noteable.class, type_id: params[:id])}"
GitLab.GfmAutoComplete.setup(); GitLab.GfmAutoComplete.setup();
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