Skip to content

Commit

Permalink
This closes #507. Add a if condition of facetValueCount > 1 to the fa…
Browse files Browse the repository at this point in the history
…cet filter build section.
  • Loading branch information
jkmarx committed Jun 22, 2015
1 parent 34b035a commit b0937ee
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions refinery/static/source/js/refinery/solr/solr_facet_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ SolrFacetView.prototype._generateTree = function( solrResponse ) {
if ( isHiddenField ) {
continue;
}


if ( attribute.is_facet && attribute.is_exposed && !attribute.is_internal ) {
if ( attribute.is_facet && attribute.is_exposed && !attribute.is_internal &&
self._countFacetValues(attribute.solr_field, facetCounts) > 1 ) {
//facets[attribute.solr_field] = [];
//Commented out the following methods which are not being used.
//var counts = self._query.getNumberOfFacetValues( attribute.solr_field );
Expand Down Expand Up @@ -263,11 +264,15 @@ SolrFacetView.prototype._generateTree = function( solrResponse ) {
}
}

SolrFacetView.prototype._countFacetValues = function( keyName, facetObj ) {
return Object.keys(facetObj[keyName]).length;
}

SolrFacetView.prototype._getFacetLabel = function( facet, facetObj ) {
var self = this;
var indicator = ""

var facetValueCount = Object.keys(facetObj[facet]).length;
var facetValueCount = self._countFacetValues(facet,facetObj);

if ( self._isFacetExpanded( facet ) ) {
indicator = "icon-caret-down";
Expand Down

0 comments on commit b0937ee

Please sign in to comment.