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

View file

@ -87,7 +87,10 @@ relative_path: ../
<script type="text/template" id="result-template">
<div class="fa-hover col-md-3 col-sm-4">
<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>
</div>
</script>