From a3795cddbb1e4ec7a697a78645d7df880bd690b3 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 15 Jan 2020 17:00:58 +0100 Subject: [PATCH] Move the search results to use list-group-flush --- app/assets/javascripts/index/search.js | 6 +++--- app/assets/stylesheets/common.scss | 7 ------- app/views/geocoder/results.html.erb | 10 +++++++--- test/controllers/geocoder_controller_test.rb | 4 ++-- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index ba66f4782..9ed243466 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -45,9 +45,9 @@ OSM.Search = function (map) { $("#sidebar_content") .on("click", ".search_more a", clickSearchMore) .on("click", ".search_results_entry a.set_position", clickSearchResult) - .on("mouseover", "p.search_results_entry:has(a.set_position)", showSearchResult) - .on("mouseout", "p.search_results_entry:has(a.set_position)", hideSearchResult) - .on("mousedown", "p.search_results_entry:has(a.set_position)", function () { + .on("mouseover", "li.search_results_entry:has(a.set_position)", showSearchResult) + .on("mouseout", "li.search_results_entry:has(a.set_position)", hideSearchResult) + .on("mousedown", "li.search_results_entry:has(a.set_position)", function () { var moved = false; $(this).one("click", function (e) { if (!moved && !$(e.target).is("a")) { diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index abae98392..5635e3f9d 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -939,15 +939,8 @@ header .search_forms, /* Rules for search sidebar */ #sidebar .search_results_entry { - ul { - padding: 0; - } - ul li { - border-bottom: $keyline; cursor: pointer; - list-style-type: none; - &:first-child { border-top: $keyline; } &.selected { background: $list-highlight; } } diff --git a/app/views/geocoder/results.html.erb b/app/views/geocoder/results.html.erb index deec4ed39..94f19d2fe 100644 --- a/app/views/geocoder/results.html.erb +++ b/app/views/geocoder/results.html.erb @@ -1,9 +1,13 @@ <% if @results.empty? %> -

<%= t ".no_results" %>

+ <% else %> -