Files
danbooru/app/views/posts/partials/common/_search.html.erb
2018-07-27 15:24:05 -07:00

34 lines
1.0 KiB
Plaintext

<!--
- path
- tags
-->
<section id="search-box">
<h1>Search</h1>
<%= form_tag(path, :method => "get") do %>
<% if params[:raw] %>
<%= hidden_field_tag :raw, params[:raw] %>
<% end %>
<% if params[:random] %>
<%= hidden_field_tag :random, params[:random] %>
<% end %>
<%= text_field_tag("tags", tags, :id => tags_dom_id, :data => { :autocomplete => "tag-query" }) %><%= content_tag "button", content_tag("i", nil, class: "fas fa-search"), type: "submit" %>
<%= hidden_field_tag "ms", "1" %>
<% end %>
</section>
<% content_for(:html_header) do %>
<script>
/*$(function() {
$("#tags").on("keypress autocompleteclose", function(e) {
if (!$(this).data("fakeWidth")) {
$(this).data("fakeWidth", $('<span>').hide().appendTo(document.body));
}
var width = $(this).data("fakeWidth").text($(this).val()).css('font', $(this).css("font")).width() + 15;
if (width > $(this).width()) {
$(this).width(width);
}
});
});*/
</script>
<% end %>