Skip to content

Commit 3bb1c00

Browse files
committed
Build
1 parent 28789a0 commit 3bb1c00

26 files changed

+646
-663
lines changed

dist/airbnb_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ecommerce_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/meetup_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/news_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/producthunt_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/simplebeds_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/yelp_recipe.bundle.js

Lines changed: 47 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actuators/ResultCard.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -670,26 +670,20 @@ var ResultCard = function (_Component) {
670670
}, {
671671
key: "listComponent",
672672
value: function listComponent() {
673-
var _this9 = this;
674-
675673
function setScroll(node) {
676674
var _this8 = this;
677675

678676
if (node) {
679677
node.addEventListener("scroll", function () {
680-
if (_this8.state.requestOnScroll && $(node).scrollTop() + $(node).innerHeight() >= node.scrollHeight && _this8.state.resultStats.total > _this8.state.currentData.length && !_this8.state.queryStart) {
678+
var scrollHeight = node.scrollHeight || node.scrollHeight === 0 ? node.scrollHeight : $(node).height();
679+
if (_this8.state.requestOnScroll && $(node).scrollTop() + $(node).innerHeight() >= scrollHeight && _this8.state.resultStats.total > _this8.state.currentData.length && !_this8.state.queryStart) {
681680
_this8.nextPage();
682681
}
683682
});
684683
}
685684
}
686-
687-
if (this.props.scrollOnWindow) {
688-
$(window).on("scroll", function () {
689-
if (_this9.state.requestOnScroll && $(window).scrollTop() + $(window).innerHeight() >= $(window).height() && _this9.state.resultStats.total > _this9.state.currentData.length && !_this9.state.queryStart) {
690-
_this9.nextPage();
691-
}
692-
});
685+
if (this.props.scrollOnTarget) {
686+
setScroll.call(this, this.props.scrollOnTarget);
693687
} else {
694688
setScroll.call(this, this.listParentElement);
695689
setScroll.call(this, this.listChildElement);
@@ -711,7 +705,7 @@ var ResultCard = function (_Component) {
711705
}, {
712706
key: "render",
713707
value: function render() {
714-
var _this10 = this;
708+
var _this9 = this;
715709

716710
var title = null,
717711
placeholder = null,
@@ -777,7 +771,7 @@ var ResultCard = function (_Component) {
777771
_react2.default.createElement(
778772
"div",
779773
{ ref: function ref(div) {
780-
_this10.listParentElement = div;
774+
_this9.listParentElement = div;
781775
}, className: "rbc-resultcard-container card thumbnail " + cx, style: this.props.componentStyle },
782776
title,
783777
sortOptions,
@@ -786,7 +780,7 @@ var ResultCard = function (_Component) {
786780
_react2.default.createElement(
787781
"div",
788782
{ ref: function ref(div) {
789-
_this10.listChildElement = div;
783+
_this9.listChildElement = div;
790784
}, className: "rbc-resultcard-scroll-container col s12 col-xs-12" },
791785
this.state.resultMarkup
792786
),
@@ -810,7 +804,7 @@ exports.default = ResultCard;
810804
ResultCard.propTypes = {
811805
componentId: _react2.default.PropTypes.string,
812806
appbaseField: _react2.default.PropTypes.string,
813-
title: _react2.default.PropTypes.string,
807+
title: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]),
814808
sortBy: _react2.default.PropTypes.oneOf(["asc", "desc", "default"]),
815809
sortOptions: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.shape({
816810
label: _react2.default.PropTypes.string,
@@ -830,7 +824,7 @@ ResultCard.propTypes = {
830824
onResultStats: _react2.default.PropTypes.func,
831825
placeholder: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]),
832826
react: _react2.default.PropTypes.object,
833-
scrollOnWindow: _react2.default.PropTypes.bool
827+
scrollOnTarget: _react2.default.PropTypes.object
834828
};
835829

836830
ResultCard.defaultProps = {
@@ -867,5 +861,5 @@ ResultCard.types = {
867861
showResultStats: _reactivemaps.TYPES.BOOLEAN,
868862
onResultStats: _reactivemaps.TYPES.FUNCTION,
869863
placeholder: _reactivemaps.TYPES.STRING,
870-
scrollOnWindow: _reactivemaps.TYPES.BOOLEAN
864+
scrollOnTarget: _reactivemaps.TYPES.OBJECT
871865
};

lib/actuators/ResultList.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -675,26 +675,20 @@ var ResultList = function (_Component) {
675675
}, {
676676
key: "listComponent",
677677
value: function listComponent() {
678-
var _this9 = this;
679-
680678
function setScroll(node) {
681679
var _this8 = this;
682680

683681
if (node) {
684682
node.addEventListener("scroll", function () {
685-
if (_this8.state.requestOnScroll && $(node).scrollTop() + $(node).innerHeight() >= node.scrollHeight && _this8.state.resultStats.total > _this8.state.currentData.length && !_this8.state.queryStart) {
683+
var scrollHeight = node.scrollHeight || node.scrollHeight === 0 ? node.scrollHeight : $(node).height();
684+
if (_this8.state.requestOnScroll && $(node).scrollTop() + $(node).innerHeight() >= scrollHeight && _this8.state.resultStats.total > _this8.state.currentData.length && !_this8.state.queryStart) {
686685
_this8.nextPage();
687686
}
688687
});
689688
}
690689
}
691-
692-
if (this.props.scrollOnWindow) {
693-
$(window).on("scroll", function () {
694-
if (_this9.state.requestOnScroll && $(window).scrollTop() + $(window).innerHeight() >= $(window).height() && _this9.state.resultStats.total > _this9.state.currentData.length && !_this9.state.queryStart) {
695-
_this9.nextPage();
696-
}
697-
});
690+
if (this.props.scrollOnTarget) {
691+
setScroll.call(this, this.props.scrollOnTarget);
698692
} else {
699693
setScroll.call(this, this.listParentElement);
700694
setScroll.call(this, this.listChildElement);
@@ -716,7 +710,7 @@ var ResultList = function (_Component) {
716710
}, {
717711
key: "render",
718712
value: function render() {
719-
var _this10 = this;
713+
var _this9 = this;
720714

721715
var title = null,
722716
placeholder = null,
@@ -779,12 +773,12 @@ var ResultList = function (_Component) {
779773
return _react2.default.createElement(
780774
"div",
781775
{ ref: function ref(div) {
782-
_this10.resultListContainer = div;
776+
_this9.resultListContainer = div;
783777
}, className: "rbc rbc-resultlist" },
784778
_react2.default.createElement(
785779
"div",
786780
{ ref: function ref(div) {
787-
_this10.listParentElement = div;
781+
_this9.listParentElement = div;
788782
}, className: "rbc-resultlist-container card thumbnail " + cx, style: this.props.componentStyle },
789783
title,
790784
sortOptions,
@@ -793,7 +787,7 @@ var ResultList = function (_Component) {
793787
_react2.default.createElement(
794788
"div",
795789
{ ref: function ref(div) {
796-
_this10.listChildElement = div;
790+
_this9.listChildElement = div;
797791
}, className: "rbc-resultlist-scroll-container col s12 col-xs-12" },
798792
this.state.resultMarkup
799793
),
@@ -817,7 +811,7 @@ exports.default = ResultList;
817811
ResultList.propTypes = {
818812
componentId: _react2.default.PropTypes.string,
819813
appbaseField: _react2.default.PropTypes.string,
820-
title: _react2.default.PropTypes.string,
814+
title: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]),
821815
sortBy: _react2.default.PropTypes.oneOf(["asc", "desc", "default"]),
822816
sortOptions: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.shape({
823817
label: _react2.default.PropTypes.string,
@@ -837,7 +831,7 @@ ResultList.propTypes = {
837831
onResultStats: _react2.default.PropTypes.func,
838832
placeholder: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]),
839833
react: _react2.default.PropTypes.object,
840-
scrollOnWindow: _react2.default.PropTypes.bool
834+
scrollOnTarget: _react2.default.PropTypes.object
841835
};
842836

843837
ResultList.defaultProps = {
@@ -874,5 +868,5 @@ ResultList.types = {
874868
showResultStats: _reactivemaps.TYPES.BOOLEAN,
875869
onResultStats: _reactivemaps.TYPES.FUNCTION,
876870
placeholder: _reactivemaps.TYPES.STRING,
877-
scrollOnWindow: _reactivemaps.TYPES.BOOLEAN
871+
scrollOnTarget: _reactivemaps.TYPES.OBJECT
878872
};

lib/actuators/ViewSwitcher.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var ViewSwitcher = function (_Component) {
8787
value: function render() {
8888
return _react2.default.createElement(
8989
"div",
90-
{ className: "rbc rbc-viewswitcher" },
90+
{ className: "rbc rbc-viewswitcher", style: this.props.componentStyle },
9191
_react2.default.createElement(
9292
"div",
9393
{ className: "rbc-list-container" },
@@ -100,4 +100,13 @@ var ViewSwitcher = function (_Component) {
100100
return ViewSwitcher;
101101
}(_react.Component);
102102

103-
exports.default = ViewSwitcher;
103+
exports.default = ViewSwitcher;
104+
105+
106+
ViewSwitcher.propTypes = {
107+
componentStyle: _react2.default.PropTypes.object
108+
};
109+
110+
ViewSwitcher.defaultProps = {
111+
componentStyle: {}
112+
};

0 commit comments

Comments
 (0)