Files
danbooru/app/views/posts/partials/common/_search.html.erb
evazion 3ae913a707 html: convert html comments to erb comments.
Avoid emitting useless comments in the html.
2018-08-17 18:55:21 -05:00

32 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-shortcut" => "q", :"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 %>