Fix broken tag autocomplete on multiple pages.
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.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= simple_form_for(:search, url: artist_commentaries_path, method: :get, defaults: { required: false }) do |f| %>
|
||||
<%= f.input :text_matches, label: "Text" %>
|
||||
<%= f.input :post_tags_match, label: "Tags" %>
|
||||
<%= f.input :post_tags_match, label: "Tags", input_html: { data: { autocomplete: "tag-query" } } %>
|
||||
<%= f.input :original_present, label: "Original present?", collection: ["yes", "no"], include_blank: true %>
|
||||
<%= f.input :translated_present, label: "Translation present?", collection: ["yes", "no"], include_blank: true %>
|
||||
<%= f.submit "Search" %>
|
||||
|
||||
Reference in New Issue
Block a user