Refactor the query results to use bootstrap list-group-flush

This commit is contained in:
Andy Allan 2020-01-08 16:00:18 +01:00
parent 17ecde019d
commit 712e67ed4a
4 changed files with 11 additions and 16 deletions

View file

@ -214,17 +214,15 @@ OSM.Query = function (map) {
if (interestingFeature(element)) {
var $li = $("<li>")
.addClass("query-result")
.addClass("query-result list-group-item")
.data("geometry", featureGeometry(element))
.appendTo($ul);
var $p = $("<p>")
.text(featurePrefix(element) + " ")
.appendTo($li);
.appendTo($ul);
$("<a>")
.attr("href", "/" + element.type + "/" + element.id)
.text(featureName(element))
.appendTo($p);
.appendTo($li);
}
}

View file

@ -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";

View file

@ -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;
}

View file

@ -12,11 +12,15 @@
<div id="query-nearby" class="query-results">
<h3><%= t(".nearby") %></h3>
<%= image_tag "searching.gif", :class => "loader" %>
<ul class="query-results-list"></ul>
<div>
<ul class="query-results-list list-group list-group-flush"></ul>
</div>
</div>
<div id="query-isin" class="query-results">
<h3><%= t(".enclosing") %></h3>
<%= image_tag "searching.gif", :class => "loader" %>
<ul class="query-results-list"></ul>
<div>
<ul class="query-results-list list-group list-group-flush"></ul>
</div>
</div>