feature-32052.patch

Mizuki ISHIKAWA, 2019-09-12 09:00

Download (2.39 KB)

View differences:

app/views/layouts/base.html.erb
80 80
        <label for='q'>
81 81
          <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project, :scope => default_search_project_scope}, :accesskey => accesskey(:search) %>:
82 82
        </label>
83
        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
83
        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search),
84
                            :data => {
85
                                :auto_complete => true,
86
                                :issues_url => auto_complete_issues_path(:q => '')
87
                            } %>
84 88
        <% end %>
85 89
        <%= render_project_jump_box %>
86 90
    </div>
app/views/search/index.html.erb
3 3
<%= form_tag({}, :method => :get, :id => 'search-form') do %>
4 4
<div class="box">
5 5
<%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
6
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
6
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input',
7
                      :data => {
8
                          :auto_complete => true,
9
                          :issues_url => auto_complete_issues_path(:q => '')
10
                      } %>
7 11
<%= project_select_tag %>
8 12
<%= hidden_field_tag 'all_words', '', :id => nil %>
9 13
<label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
public/javascripts/application.js
1036 1036
    const tribute = new Tribute({
1037 1037
      trigger: '#',
1038 1038
      values: function (text, cb) {
1039
        if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
1040
          $(element).attr('autocomplete', 'off');
1041
        }
1039 1042
        remoteSearch(issuesUrl + text, function (issues) {
1040 1043
          return cb(issues);
1041 1044
        });