From: Tom Hughes Date: Mon, 16 Dec 2013 09:39:54 +0000 (+0000) Subject: Restore the duplicate search form in the header X-Git-Tag: live~5111 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/dd12e1de637d5242c8ac7ed933fd8a3f70a70367 Restore the duplicate search form in the header It turns out the duplicate form is used, for the the mobile view. --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index a300cc280..55e612f17 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -229,7 +229,7 @@ $(document).ready(function () { page.load = function() { if (!("autofocus" in document.createElement("input"))) { - $(".search_form input[name=query]").focus(); + $("#sidebar .search_form input[name=query]").focus(); } return map.getState(); }; diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 55ce54219..732e57d31 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -1,7 +1,7 @@ <%= form_tag search_path, :class => "search_form" do %> <%= submit_tag t('site.search.submit_text') %>
- + <%= text_field_tag "query", params[:query], :placeholder => t("site.search.search"), :autofocus => autofocus %> <%= link_to t('site.search.where_am_i'), '#', { :class => "describe_location", :title => t('site.search.where_am_i_title') } %>
<% end %> diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index ab2d0f77a..e72214cbe 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -16,9 +16,13 @@ <% end %> <% end %> +<% content_for :header do %> + <%= render :partial => "layouts/search", :locals => { :autofocus => false } %> +<% end %> + <% content_for :content do %>