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);
}
$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);
}
$("#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")) {
/* 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; }
}
<% 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 %>
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