Files
danbooru/app/components/autocomplete_component/autocomplete_component.html.erb
evazion 6b6c452ea2 autocomplete: remove unused html data attributes.
Remove the `data-autocomplete-antecedent`, `data-autocomplete-category`,
and `data-autocomplete-post-count` data attributes from the autocomplete
menu. These weren't used by Danbooru itself and they bloat the HTML.
2022-09-02 13:56:53 -05:00

22 lines
781 B
Plaintext

<ul>
<% autocomplete_results.each do |result| %>
<%= tag.li class: "ui-menu-item", "data-autocomplete-type": result.type, "data-autocomplete-value": result.value do %>
<div class="ui-menu-item-wrapper" tabindex="-1">
<%= link_to_result result do %>
<% if result.antecedent.present? %>
<span class="autocomplete-antecedent"><%= highlight_antecedent(result) %></span>
<span class="autocomplete-arrow">→</span>
<%= result.label %>
<% else %>
<%= highlight_result(result) %>
<% end %>
<% end %>
<% if result.post_count %>
<%= tag.span humanized_number(result.post_count), class: "post-count" %>
<% end %>
</div>
<% end %>
<% end %>
</ul>