]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/2509'
authorTom Hughes <tom@compton.nu>
Thu, 16 Jan 2020 11:42:12 +0000 (11:42 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 16 Jan 2020 11:42:12 +0000 (11:42 +0000)
app/assets/javascripts/index/query.js
app/assets/javascripts/index/search.js
app/assets/stylesheets/common.scss
app/views/geocoder/results.html.erb
test/controllers/geocoder_controller_test.rb

index 514d6dbb25b6b6619a481de954802cbbd2f10ea4..7d02760ced95afb9a0ed1793cb2a3c74b0df505f 100644 (file)
@@ -228,12 +228,14 @@ OSM.Query = function (map) {
 
         if (results.remark) {
           $("<li>")
+            .addClass("query-result list-group-item")
             .text(I18n.t("javascripts.query.error", { server: url, error: results.remark }))
             .appendTo($ul);
         }
 
         if ($ul.find("li").length === 0) {
           $("<li>")
+            .addClass("query-result list-group-item")
             .text(I18n.t("javascripts.query.nothing_found"))
             .appendTo($ul);
         }
@@ -242,6 +244,7 @@ OSM.Query = function (map) {
         $section.find(".loader").stopTime("loading").hide();
 
         $("<li>")
+          .addClass("query-result list-group-item")
           .text(I18n.t("javascripts.query." + status, { server: url, error: error }))
           .appendTo($ul);
       }
index ba66f478255d4e9d65e6c16066743b38da28ae97..9ed243466d2a9402053e24a1247f8a5053085d85 100644 (file)
@@ -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")) {
index abae98392b143305c35c024bbf2d0d6807582a4e..5635e3f9d5a8b8796e7ff9732f212fbb3c99e050 100644 (file)
@@ -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; }
   }
 
index deec4ed3939665f725c89133a3a73d75fbcd6f7c..94f19d2feec9960627c916edf0d6216b013793ef 100644 (file)
@@ -1,9 +1,13 @@
 <% if @results.empty? %>
-  <p class="search_results_entry inner12"><%= t ".no_results" %></p>
+  <ul class="list-group list-group-flush">
+    <li class="list-group-item">
+      <%= t ".no_results" %>
+    </li>
+  </ul>
 <% else %>
-  <ul class='results-list'>
+  <ul class='results-list list-group list-group-flush'>
     <% @results.each do |result| %>
-      <li><p class="inner12 search_results_entry clearfix"><%= result_to_html(result) %></p></li>
+      <li class="list-group-item search_results_entry"><%= result_to_html(result) %></li>
     <% end %>
   </ul>
   <% if @more_params %>
index f8a4eed1964e84fd44cd7ff31f9a0dbf6a2769cf..0459eb2946ebb4762331445afbb248eb0ad91899 100644 (file)
@@ -489,11 +489,11 @@ class GeocoderControllerTest < ActionController::TestCase
       assert_select "ul.results-list", 0
     else
       assert_select "ul.results-list", 1 do
-        assert_select "p.search_results_entry", results.count
+        assert_select "li.search_results_entry", results.count
 
         results.each do |result|
           attrs = result.collect { |k, v| "[data-#{k}='#{v}']" }.join("")
-          assert_select "p.search_results_entry a.set_position#{attrs}", result[:name]
+          assert_select "li.search_results_entry a.set_position#{attrs}", result[:name]
         end
       end
     end