ソースを参照

Auto-complete issues #id in the search form (#32052).

Patch by Mizuki ISHIKAWA.


git-svn-id: http://svn.redmine.org/redmine/trunk@18498 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.1.0
Go MAEDA 4年前
コミット
f5bbb0317a
3個のファイルの変更13行の追加2行の削除
  1. 5
    1
      app/views/layouts/base.html.erb
  2. 5
    1
      app/views/search/index.html.erb
  3. 3
    0
      public/javascripts/application.js

+ 5
- 1
app/views/layouts/base.html.erb ファイルの表示

@@ -80,7 +80,11 @@
<label for='q'>
<%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project, :scope => default_search_project_scope}, :accesskey => accesskey(:search) %>:
</label>
<%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
<%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search),
:data => {
:auto_complete => true,
:issues_url => auto_complete_issues_path(:q => '')
} %>
<% end %>
<%= render_project_jump_box %>
</div>

+ 5
- 1
app/views/search/index.html.erb ファイルの表示

@@ -3,7 +3,11 @@
<%= form_tag({}, :method => :get, :id => 'search-form') do %>
<div class="box">
<%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input',
:data => {
:auto_complete => true,
:issues_url => auto_complete_issues_path(:q => '')
} %>
<%= project_select_tag %>
<%= hidden_field_tag 'all_words', '', :id => nil %>
<label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>

+ 3
- 0
public/javascripts/application.js ファイルの表示

@@ -1036,6 +1036,9 @@ function inlineAutoComplete(element) {
const tribute = new Tribute({
trigger: '#',
values: function (text, cb) {
if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
$(element).attr('autocomplete', 'off');
}
remoteSearch(issuesUrl + text, function (issues) {
return cb(issues);
});

読み込み中…
キャンセル
保存