From 712e67ed4a1429309075b484b87a42ca5da6b0a5 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 8 Jan 2020 16:00:18 +0100 Subject: [PATCH] Refactor the query results to use bootstrap list-group-flush --- app/assets/javascripts/index/query.js | 8 +++----- app/assets/stylesheets/_bootstrap-custom.scss | 2 +- app/assets/stylesheets/common.scss | 9 +-------- app/views/browse/query.html.erb | 8 ++++++-- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 5c6e58170..514d6dbb2 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -214,17 +214,15 @@ OSM.Query = function (map) { if (interestingFeature(element)) { var $li = $("
  • ") - .addClass("query-result") + .addClass("query-result list-group-item") .data("geometry", featureGeometry(element)) - .appendTo($ul); - var $p = $("

    ") .text(featurePrefix(element) + " ") - .appendTo($li); + .appendTo($ul); $("") .attr("href", "/" + element.type + "/" + element.id) .text(featureName(element)) - .appendTo($p); + .appendTo($li); } } diff --git a/app/assets/stylesheets/_bootstrap-custom.scss b/app/assets/stylesheets/_bootstrap-custom.scss index 96d37415f..c07fc2d07 100644 --- a/app/assets/stylesheets/_bootstrap-custom.scss +++ b/app/assets/stylesheets/_bootstrap-custom.scss @@ -32,7 +32,7 @@ @import "bootstrap/alert"; // @import "bootstrap/progress"; // @import "bootstrap/media"; -// @import "bootstrap/list-group"; +@import "bootstrap/list-group"; // @import "bootstrap/close"; // @import "bootstrap/toasts"; // @import "bootstrap/modal"; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 3d013339d..68fc8702c 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1277,17 +1277,10 @@ tr.turn:hover { .query-results { display: none; - - h3 { - padding: $lineheight $lineheight $lineheight/2; - margin: 0; - } + padding: 0 $lineheight $lineheight/2; ul { li { - padding: 15px 20px; - border-bottom: 1px solid $grey; - &.query-result { cursor: pointer; } diff --git a/app/views/browse/query.html.erb b/app/views/browse/query.html.erb index ea40a00db..ad6fdddb5 100644 --- a/app/views/browse/query.html.erb +++ b/app/views/browse/query.html.erb @@ -12,11 +12,15 @@

    <%= t(".enclosing") %>

    <%= image_tag "searching.gif", :class => "loader" %> -
      +
      +
        +
        -- 2.39.5