Fix card infinite scrolling on card activities

I imagine blaze-component changed their Mixins API since I written
this code. We need some tests to avoid this kind of regressions when
updating dependencies!

Fixes #420
This commit is contained in:
Maxime Quandalle 2016-01-03 23:22:08 +01:00
parent 8c01d51577
commit 46747b01fb
3 changed files with 8 additions and 11 deletions

View file

@ -17,11 +17,6 @@ Mixins.InfiniteScrolling = BlazeComponent.extendComponent({
this._nextPeak = Infinity;
},
// To be overwritten by consumers of this mixin
reachNextPeak() {
},
events() {
return [{
scroll(evt) {
@ -29,7 +24,7 @@ Mixins.InfiniteScrolling = BlazeComponent.extendComponent({
let altitude = domElement.scrollTop + domElement.offsetHeight;
altitude += peakAnticipation;
if (altitude >= this.callFirstWith(null, 'getNextPeak')) {
this.callFirstWith(null, 'reachNextPeak');
this.mixinParent().callFirstWith(null, 'reachNextPeak');
}
},
}];