Updates to matches

This commit is contained in:
Travis Chase 2015-09-01 11:15:14 -05:00
parent 5efce50446
commit ce962ca567
2 changed files with 5 additions and 3 deletions

View File

@ -70,7 +70,7 @@ $(function() {
this.pullMatches(matches, this.result._highlightResult.aliases); this.pullMatches(matches, this.result._highlightResult.aliases);
this.pullMatches(matches, this.result._highlightResult.synonyms); this.pullMatches(matches, this.result._highlightResult.synonyms);
return this.template({ result: this.result, matches: matches.join(", ") }); return this.template({ result: this.result, matches: matches });
}, },
pullMatches: function(matches, list) { pullMatches: function(matches, list) {
@ -84,7 +84,6 @@ $(function() {
} }
}); });
var $searchViewElement = $("[data-view=search]"); var $searchViewElement = $("[data-view=search]");
if ($searchViewElement.length > 0) { if ($searchViewElement.length > 0) {

View File

@ -87,7 +87,10 @@ relative_path: ../
<script type="text/template" id="result-template"> <script type="text/template" id="result-template">
<div class="fa-hover col-md-3 col-sm-4"> <div class="fa-hover col-md-3 col-sm-4">
<a href="{{ page.relative_path }}icon/<%= result.name %>"> <a href="{{ page.relative_path }}icon/<%= result.name %>">
<i class="fa <%= result.css_class %>"></i> <%= result._highlightResult.name.value %> <% if (matches !== "") { %>(<%= matches %>)<% } %> <i class="fa <%= result.css_class %>"></i> <%= result._highlightResult.name.value %>
<% if (matches.length > 0) { %>
<span class="text-muted">(<%= matches.join(", ") %>)</span>
<% } %>
</a> </a>
</div> </div>
</script> </script>