The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wekan/client/components/sidebar/infiniteScrolling.js

37 lines
800 B

var peakAnticipation = 200;
Mixins.InfiniteScrolling = BlazeComponent.extendComponent({
onCreated: function() {
this._nextPeak = Infinity;
},
setNextPeak: function(v) {
this._nextPeak = v;
},
getNextPeak: function() {
return this._nextPeak;
},
resetNextPeak: function() {
this._nextPeak = Infinity;
},
// To be overwritten by consumers of this mixin
reachNextPeak: function() {
},
events: function() {
return [{
scroll: function(evt) {
var domElement = evt.currentTarget;
var altitude = domElement.scrollTop + domElement.offsetHeight;
altitude += peakAnticipation;
if (altitude >= this.callFirstWith(null, 'getNextPeak')) {
this.callFirstWith(null, 'reachNextPeak');
}
}
}];
}
});