Skip to content

Commit 21877a0

Browse files
author
vvo
committed
fix(hideIfEmpty): should be hideWhenNoResults
dunno why it was commited this way. reverting
1 parent 3cc48f3 commit 21877a0

File tree

10 files changed

+30
-30
lines changed

10 files changed

+30
-30
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ search.addWidget(
265265
* @param {String|DOMElement} options.container Valid CSS Selector as a string or DOMElement
266266
* @param {Array} options.indices Array of objects defining the different indices to choose from. Each object must contain a `name` and `label` key.
267267
* @param {String} [options.cssClass] Class name(s) to be added to the generated select element
268-
* @param {boolean} [hideIfEmpty=false] Hide the container when no results match
268+
* @param {boolean} [hideWhenNoResults=false] Hide the container when no results match
269269
* @return {Object}
270270
*/
271271
```
@@ -362,7 +362,7 @@ search.addWidget(
362362
* @param {String} options.label Human-readable name of the filter (eg. "Free Shipping")
363363
* @param {String|Function} [options.template] Item template, provided with `label` and `isRefined`
364364
* @param {Function} [options.transformData] Function to change the object passed to the item template
365-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
365+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
366366
* @return {Object}
367367
*/
368368
```
@@ -395,7 +395,7 @@ search.addWidget(
395395
* @param {Function} [options.transformData] Function to change the object passed to the item template
396396
* @param {String|Function} [options.singleRefine=true] Are multiple refinements allowed or only one at the same time. You can use this
397397
* to build radio based refinement lists for example
398-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
398+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
399399
* @return {Object}
400400
*/
401401
```
@@ -439,7 +439,7 @@ search.addWidget(
439439
* @param {String|Function} [options.templates.item='<a href="{{href}}">{{name}}</a> {{count}}'] Item template, provided with `name`, `count`, `isRefined`
440440
* @param {String|Function} [options.templates.footer=''] Footer template
441441
* @param {Function} [options.transformData] Function to change the object passed to the item template
442-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
442+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
443443
* @return {Object}
444444
*/
445445
```
@@ -476,7 +476,7 @@ search.addWidget(
476476
* You can also provide
477477
* tooltips: {format: function(formattedValue, rawValue) {return '$' + formattedValue}}
478478
* So that you can format the tooltip display value as you want
479-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
479+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
480480
* @return {Object}
481481
*/
482482
```

decorators/autoHide.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ function autoHide(ComposedComponent) {
1212

1313
_hideOrShowContainer(props) {
1414
var container = React.findDOMNode(this).parentNode;
15-
if (props.hideIfEmpty === true && props.hasResults === false) {
15+
if (props.hideWhenNoResults === true && props.hasResults === false) {
1616
container.style.display = 'none';
17-
} else if (props.hideIfEmpty === true) {
17+
} else if (props.hideWhenNoResults === true) {
1818
container.style.display = '';
1919
}
2020
}
2121

2222
render() {
2323
if (this.props.hasResults === false &&
24-
this.props.hideIfEmpty === true) {
24+
this.props.hideWhenNoResults === true) {
2525
return <div/>;
2626
}
2727

@@ -31,7 +31,7 @@ function autoHide(ComposedComponent) {
3131

3232
AutoHide.propTypes = {
3333
hasResults: React.PropTypes.bool.isRequired,
34-
hideIfEmpty: React.PropTypes.bool.isRequired
34+
hideWhenNoResults: React.PropTypes.bool.isRequired
3535
};
3636

3737
// precise displayName for ease of debugging (react dev tool, react warnings)

widgets/hits.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function hits({
66
container = null,
77
templates = {},
88
transformData = {},
9-
hideIfEmpty = false,
9+
hideWhenNoResults = false,
1010
hitsPerPage = 20
1111
}) {
1212
var Hits = require('../components/Hits');
@@ -23,7 +23,7 @@ function hits({
2323
helper={helper}
2424
noResultsTemplate={templates.empty}
2525
noResultsTransformData={transformData.empty}
26-
hideIfEmpty={hideIfEmpty}
26+
hideWhenNoResults={hideWhenNoResults}
2727
hasResults={results.hits.length > 0}
2828
hitTemplate={templates.hit}
2929
hitTransformData={transformData.hit}

widgets/index-selector.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ var utils = require('../lib/utils.js');
88
* @param {String|DOMElement} options.container Valid CSS Selector as a string or DOMElement
99
* @param {Array} options.indices Array of objects defining the different indices to choose from. Each object must contain a `name` and `label` key.
1010
* @param {String} [options.cssClass] Class name(s) to be added to the generated select element
11-
* @param {boolean} [hideIfEmpty=false] Hide the container when no results match
11+
* @param {boolean} [hideWhenNoResults=false] Hide the container when no results match
1212
* @return {Object}
1313
*/
1414
function indexSelector({
1515
container = null,
1616
indices = null,
1717
cssClass,
18-
hideIfEmpty = false
18+
hideWhenNoResults = false
1919
}) {
2020
var IndexSelector = require('../components/IndexSelector');
2121
var containerNode = utils.getContainerNode(container);
@@ -42,7 +42,7 @@ function indexSelector({
4242
cssClass={cssClass}
4343
currentIndex={helper.getIndex()}
4444
indices={indices}
45-
hideIfEmpty={hideIfEmpty}
45+
hideWhenNoResults={hideWhenNoResults}
4646
hasResults={results.hits.length > 0}
4747
setIndex={helper.setIndex.bind(helper)}
4848
/>,

widgets/menu.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var defaults = require('lodash/object/defaults');
2828
* @param {String|Function} [options.templates.item='<a href="{{href}}">{{name}}</a> {{count}}'] Item template, provided with `name`, `count`, `isRefined`
2929
* @param {String|Function} [options.templates.footer=''] Footer template
3030
* @param {Function} [options.transformData] Method to change the object passed to the item template
31-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
31+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
3232
* @return {Object}
3333
*/
3434
function menu({
@@ -41,7 +41,7 @@ function menu({
4141
list: null,
4242
item: null
4343
},
44-
hideIfEmpty = true,
44+
hideWhenNoResults = true,
4545
templates = defaultTemplates,
4646
transformData = null
4747
}) {
@@ -78,7 +78,7 @@ function menu({
7878
facetValues={facetValues}
7979
templates={templates}
8080
transformData={transformData}
81-
hideIfEmpty={hideIfEmpty}
81+
hideWhenNoResults={hideWhenNoResults}
8282
hasResults={facetValues.length > 0}
8383
toggleRefinement={toggleRefinement.bind(null, helper, hierarchicalFacetName)}
8484
/>,

widgets/pagination.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function pagination({
88
labels,
99
maxPages,
1010
showFirstLast,
11-
hideIfEmpty = true
11+
hideWhenNoResults = true
1212
}) {
1313
var Pagination = require('../components/Pagination/Pagination.js');
1414

@@ -28,7 +28,7 @@ function pagination({
2828
nbPages={nbPages}
2929
setCurrentPage={helper.setCurrentPage.bind(helper)}
3030
cssClass={cssClass}
31-
hideIfEmpty={hideIfEmpty}
31+
hideWhenNoResults={hideWhenNoResults}
3232
hasResults={results.hits.length > 0}
3333
labels={labels}
3434
showFirstLast={showFirstLast}

widgets/range-slider.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ var utils = require('../lib/utils.js');
1111
* You can also provide
1212
* tooltips: {format: function(formattedValue, rawValue) {return '$' + formattedValue}}
1313
* So that you can format the tooltip display value as you want
14-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
14+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
1515
* @return {Object}
1616
*/
1717
function rangeSlider({
1818
container = null,
1919
facetName = null,
2020
tooltips = true,
21-
hideIfEmpty = true
21+
hideWhenNoResults = true
2222
}) {
2323
var Slider = require('../components/Slider');
2424

@@ -71,7 +71,7 @@ function rangeSlider({
7171
<Slider
7272
start={[currentRefinement.min, currentRefinement.max]}
7373
range={{min: stats.min, max: stats.max}}
74-
hideIfEmpty={hideIfEmpty}
74+
hideWhenNoResults={hideWhenNoResults}
7575
hasResults={stats.min !== null && stats.max !== null}
7676
onChange={this._refine.bind(this, helper)}
7777
tooltips={tooltips}

widgets/refinement-list.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var defaults = require('lodash/object/defaults');
3232
* @param {Function} [options.transformData] Function to change the object passed to the item template
3333
* @param {String|Function} [options.singleRefine=true] Are multiple refinements allowed or only one at the same time. You can use this
3434
* to build radio based refinement lists for example
35-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
35+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
3636
* @return {Object}
3737
*/
3838
function refinementList({
@@ -46,7 +46,7 @@ function refinementList({
4646
list: null,
4747
item: null
4848
},
49-
hideIfEmpty = true,
49+
hideWhenNoResults = true,
5050
templates = defaultTemplates,
5151
transformData = null,
5252
singleRefine = false
@@ -87,7 +87,7 @@ function refinementList({
8787
facetValues={facetValues}
8888
templates={templates}
8989
transformData={transformData}
90-
hideIfEmpty={hideIfEmpty}
90+
hideWhenNoResults={hideWhenNoResults}
9191
hasResults={facetValues.length > 0}
9292
toggleRefinement={toggleRefinement.bind(null, helper, singleRefine, facetName)}
9393
/>,

widgets/stats/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function stats({
77
container = null,
88
template = defaultTemplate,
99
transformData = null,
10-
hideIfEmpty = true
10+
hideWhenNoResults = true
1111
}) {
1212
var Stats = require('../../components/Stats');
1313
var containerNode = utils.getContainerNode(container);
@@ -21,7 +21,7 @@ function stats({
2121
React.render(
2222
<Stats
2323
hasResults={results.hits.length > 0}
24-
hideIfEmpty={hideIfEmpty}
24+
hideWhenNoResults={hideWhenNoResults}
2525
hitsPerPage={results.hitsPerPage}
2626
nbHits={results.nbHits}
2727
nbPages={results.nbPages}

widgets/toggle.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var defaultTemplate = '<label>{{label}}<input type="checkbox" {{#isRefined}}chec
1212
* @param {String} options.label Human-readable name of the filter (eg. "Free Shipping")
1313
* @param {String|Function} [options.template] Item template, provided with `label` and `isRefined`
1414
* @param {Function} [options.transformData] Function to change the object passed to the item template
15-
* @param {boolean} [hideIfEmpty=true] Hide the container when no results match
15+
* @param {boolean} [hideWhenNoResults=true] Hide the container when no results match
1616
* @return {Object}
1717
*/
1818
function toggle({
@@ -21,7 +21,7 @@ function toggle({
2121
label = null,
2222
template = defaultTemplate,
2323
transformData = null,
24-
hideIfEmpty = true
24+
hideWhenNoResults = true
2525
}) {
2626
var Toggle = require('../components/Toggle');
2727

@@ -50,7 +50,7 @@ function toggle({
5050
label={label}
5151
template={template}
5252
transformData={transformData}
53-
hideIfEmpty={hideIfEmpty}
53+
hideWhenNoResults={hideWhenNoResults}
5454
hasResults={results.hits.length > 0}
5555
toggleFilter={toggleFilter}
5656
/>,

0 commit comments

Comments
 (0)