Skip to content

Commit

Permalink
This closes #729 by adding a conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkmarx committed Oct 2, 2015
1 parent d66a25a commit 9394fc3
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions refinery/static/source/js/refinery/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,31 +163,35 @@
}
}

var evenInd = 0;
var oddInd = 1;
var facetOneInd = 0;
//conditional is required because visibleFacets has incorrect
// isExposed attributes
while(evenInd <= visibleFacets.length - 1) {
if(!(visibleFacets[evenInd].indexOf("ANALYSIS") > -1 ||
visibleFacets[evenInd].indexOf("WORKFLOW_OUTPUT") > -1))
while(facetOneInd <= visibleFacets.length - 1) {
if(!(visibleFacets[facetOneInd].indexOf("ANALYSIS") > -1 ||
visibleFacets[facetOneInd].indexOf("WORKFLOW_OUTPUT") > -1))
{
pivotMatrixView.setFacet1(visibleFacets[evenInd]);
pivotMatrixView.setFacet1(visibleFacets[facetOneInd]);
break;
} else {
evenInd = evenInd + 2;
facetOneInd = facetOneInd + 1;
}
};
while(oddInd <= visibleFacets.length - 1){
if(!(visibleFacets[oddInd].indexOf("ANALYSIS") > -1 ||
visibleFacets[oddInd].indexOf("WORKFLOW_OUTPUT") > -1))

var facetTwoInd = facetOneInd + 1;
while(facetTwoInd <= visibleFacets.length - 1){
if(!(visibleFacets[facetTwoInd].indexOf("ANALYSIS") > -1 ||
visibleFacets[facetTwoInd].indexOf("WORKFLOW_OUTPUT") > -1))
{
pivotMatrixView.setFacet2(visibleFacets[oddInd]);
pivotMatrixView.setFacet2(visibleFacets[facetTwoInd]);
break;
} else {
oddInd = oddInd + 2;
facetTwoInd = facetTwoInd + 1;
}
};
query.setPivots(visibleFacets[evenInd], visibleFacets[oddInd]);

if(pivotMatrixView.getFacet1 !== undefined && pivotMatrixView.getFacet2 !== undefined ) {
query.setPivots(visibleFacets[facetOneInd], visibleFacets[facetTwoInd]);
}
}

client.run(query, SOLR_FULL_QUERY);
Expand Down

0 comments on commit 9394fc3

Please sign in to comment.