diff options
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_layout.scss | 4 | ||||
-rw-r--r-- | app/views/request/_search_ahead.html.erb | 1 | ||||
-rw-r--r-- | app/views/request/new.html.erb | 9 |
3 files changed, 11 insertions, 3 deletions
diff --git a/app/assets/stylesheets/responsive/_new_request_layout.scss b/app/assets/stylesheets/responsive/_new_request_layout.scss index a2ab23060..a8b24e1b1 100644 --- a/app/assets/stylesheets/responsive/_new_request_layout.scss +++ b/app/assets/stylesheets/responsive/_new_request_layout.scss @@ -58,6 +58,10 @@ } } +#typeahead_response .close-button { + float: right; +} + /* Advice sits on right hand side */ #request_advice { diff --git a/app/views/request/_search_ahead.html.erb b/app/views/request/_search_ahead.html.erb index 62c7c65af..4fbe06ebc 100644 --- a/app/views/request/_search_ahead.html.erb +++ b/app/views/request/_search_ahead.html.erb @@ -1,6 +1,7 @@ <% unless @xapian_requests.nil? %> <div id="request_search_ahead_results"> <% if @xapian_requests.results.any? %> + <span class="close-button">X</span> <h3><%= _("Possibly related requests:") %></h3> <% @xapian_requests.results.each do |result| %> diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 4840b5064..f6194fb41 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -1,21 +1,24 @@ <% unless @batch %> <script type="text/javascript"> $(document).ready(function(){ - // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin: + // Avoid triggering too often (on each keystroke) by using the + // debounce jQuery plugin: // http://benalman.com/projects/jquery-throttle-debounce-plugin/ $("#typeahead_search").keypress($.debounce( 300, function() { $("#typeahead_response").load("<%= search_ahead_url %>?q="+encodeURI(this.value)+ "&requested_from=<%= @info_request.public_body.url_name %>"+ "&per_page=3", function() { - // When following links in typeahead results, open new tab/window + // When following links in typeahead results, open new + // tab/window $("#typeahead_response a").attr("target","_blank"); // Update the public body site search link $("#body-site-search-link").attr("href", "http://www.google.com/#q="+encodeURI($("#typeahead_search").val())+ "+site:<%= @info_request.public_body.calculated_home_page %>"); + + $('.close-button').click(function() { $(this).parent().hide() }); }); })); - }); </script> <% end %> |