summaryrefslogtreecommitdiff
path: root/app/views/layouts/_init_auto_complete.html.haml
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-10-13 04:33:09 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2016-12-15 15:20:33 +0000
commit1356e40f22c555f676777ed9385a12b09c19fdce (patch)
treeb8291341f9ea2dbdda5db5254b70bf631162ae69 /app/views/layouts/_init_auto_complete.html.haml
parent677e7e837e3fb41deb46cb77de8b9395d031c07c (diff)
downloadgitlab-ce-1356e40f22c555f676777ed9385a12b09c19fdce.tar.gz
Changed autocomplete_sources into an action that returns a single 'at' type of sources at a time18435-autocomplete-is-not-performant
Finished up autocomplete_sources action and added frontend to fetch data only when its needed Added wait_for_ajax to specs Fixed builds and improved the setup/destroy lifecycle Changed global namespace and DRYed up loading logic Added safety for accidentally loading data twice Removed destroy as its not necessary and is messing with click events from a blur race condition Created AutocompleteSourcesController and updated routes Fixed @undefined from tabbing before load ends Disable tabSelectsMatch until we have loaded data Review changes
Diffstat (limited to 'app/views/layouts/_init_auto_complete.html.haml')
-rw-r--r--app/views/layouts/_init_auto_complete.html.haml14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml
index e138ebab018..3daa1e90a8c 100644
--- a/app/views/layouts/_init_auto_complete.html.haml
+++ b/app/views/layouts/_init_auto_complete.html.haml
@@ -3,6 +3,14 @@
- if project
:javascript
- GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: noteable_type, type_id: params[:id])}"
- GitLab.GfmAutoComplete.cachedData = undefined;
- GitLab.GfmAutoComplete.setup();
+ gl.GfmAutoComplete.dataSources = {
+ emojis: "#{emojis_namespace_project_autocomplete_sources_path(project.namespace, project)}",
+ members: "#{members_namespace_project_autocomplete_sources_path(project.namespace, project, type: noteable_type, type_id: params[:id])}",
+ issues: "#{issues_namespace_project_autocomplete_sources_path(project.namespace, project)}",
+ mergeRequests: "#{merge_requests_namespace_project_autocomplete_sources_path(project.namespace, project)}",
+ labels: "#{labels_namespace_project_autocomplete_sources_path(project.namespace, project)}",
+ milestones: "#{milestones_namespace_project_autocomplete_sources_path(project.namespace, project)}",
+ commands: "#{commands_namespace_project_autocomplete_sources_path(project.namespace, project, type: noteable_type, type_id: params[:id])}"
+ };
+
+ gl.GfmAutoComplete.setup();