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 @@
|
||||
|
||||
<section>
|
||||
<%= form_tag(meta_searches_tags_path, :method => :get) do %>
|
||||
<%= text_field_tag "name", params[:name] %>
|
||||
<%= text_field_tag "name", params[:name], :data => { :autocomplete => "tag" } %>
|
||||
<%= submit_tag "Go" %>
|
||||
<% end %>
|
||||
</section>
|
||||
@@ -126,4 +126,4 @@
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
MetaSearch - Tags - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user