1356e40f22
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
16 lines
1,010 B
Text
16 lines
1,010 B
Text
- project = @target_project || @project
|
|
- noteable_type = @noteable.class if @noteable.present?
|
|
|
|
- if project
|
|
:javascript
|
|
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();
|