Mark all tag <input>s with a `data-autocomplete` attribute, instead of
hardcoding a list of html IDs to autocomplete in javascript.
This way should be less error prone. It fixes autocomplete in several places:
* Autocomplete for the search box on /posts didn't work in the
responsive layout. This was because /posts has two search boxes that
both have the id `tags`: one in the normal sidebar, and one in the
responsive tag list. $("#tags") only initialized autocomplete on the
first one.
* Autocomplete didn't work on the aliases or implications pages. This
was due to selecting the wrong html ids.
21 lines
623 B
Plaintext
21 lines
623 B
Plaintext
<div id="c-notes">
|
|
<div id="a-search">
|
|
<h1>Search Notes</h1>
|
|
|
|
<%= simple_form_for(:search, url: notes_path, method: :get, defaults: { required: false }) do |f| %>
|
|
<%= f.hidden_field :group_by, value: "note" %>
|
|
|
|
<%= f.input :body_matches, label: "Body" %>
|
|
<%= f.input :creator_name, label: "Author" %>
|
|
<%= f.input :post_tags_match, label: "Tags", input_html: { data: { autocomplete: "tag-query" } } %>
|
|
<%= f.submit "Search" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render "secondary_links" %>
|
|
|
|
<% content_for(:page_title) do %>
|
|
Search Notes - <%= Danbooru.config.app_name %>
|
|
<% end %>
|