Skip to content

Commit

Permalink
fix(range-slider): fixes bound definition
Browse files Browse the repository at this point in the history
in the case other component use the same attribute as conjunctive facet.

Also updates the version of noUISlider to fix part of the bounds
problems.
  • Loading branch information
Alexandre Stanislawski committed Nov 5, 2015
1 parent 68adc0d commit e15c9b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"lodash": "^3.10.1",
"react": "^0.14.0",
"react-dom": "^0.14.0",
"react-nouislider": "^1.5.1",
"react-nouislider": "^1.5.2",
"to-factory": "^1.0.0"
},
"license": "MIT"
Expand Down
11 changes: 9 additions & 2 deletions widgets/range-slider/range-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ function rangeSlider({
}
helper.search();
},
getDisjunctiveFacetPosition(results, facetName) {
let facets = results.disjunctiveFacets;
for (let i = 0; facets.length; i++) {
if (facets[i].name === facetName) return i;
}
return -1;
},
render({results, helper, templatesConfig}) {
let stats = results.getFacetStats(attributeName);

let facetPosition = this.getDisjunctiveFacetPosition(results, attributeName);
let stats = results.disjunctiveFacets[facetPosition].stats;
let currentRefinement = this._getCurrentRefinement(helper);

if (stats === undefined) {
Expand Down

0 comments on commit e15c9b7

Please sign in to comment.