diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5a0868c2e..dd4a4f195 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1741,6 +1741,22 @@ module ApplicationHelper
end
end
+ def autocomplete_data_sources(project)
+ {
+ issues: auto_complete_issues_path(:project_id => project, :q => '')
+ }
+ end
+
+ def heads_for_auto_complete(project)
+ data_sources = autocomplete_data_sources(project)
+
+ javascript_tag(
+ "rm = window.rm || {};" +
+ "rm.AutoComplete = rm.AutoComplete || {};" +
+ "rm.AutoComplete.dataSources = '#{data_sources.to_json}';"
+ )
+ end
+
private
def wiki_helper
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index 1e0c1b07e..41b20c46a 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -84,9 +84,8 @@ module CustomFieldsHelper
if custom_value.custom_field.full_text_formatting?
css += ' wiki-edit'
data = {
- :auto_complete => true,
- :issues_url => auto_complete_issues_path(:project_id => custom_value.customized.project, :q => '')
- } if custom_value.customized&.try(:project)
+ :auto_complete => true
+ }
end
custom_value.custom_field.format.edit_tag(
self,
@@ -133,8 +132,7 @@ module CustomFieldsHelper
if custom_field.full_text_formatting?
css += ' wiki-edit'
data = {
- :auto_complete => true,
- :issues_url => auto_complete_issues_path(:q => '')
+ :auto_complete => true
}
end
custom_field.format.bulk_edit_tag(
diff --git a/app/views/documents/_form.html.erb b/app/views/documents/_form.html.erb
index b8b8c8404..45b63611f 100644
--- a/app/views/documents/_form.html.erb
+++ b/app/views/documents/_form.html.erb
@@ -5,8 +5,7 @@
<%= f.text_field :title, :required => true, :size => 60 %>
<%= f.text_area :description, :cols => 60, :rows => 15, :class => 'wiki-edit',
:data => {
- :auto_complete => true,
- :issues_url => auto_complete_issues_path(:project_id => @project, :q => '')
+ :auto_complete => true
}
%>
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index cc2f110b7..33f8352f5 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -31,8 +31,7 @@