MOBILE-2841 infinite: Don't send event if position is top

main
Dani Palou 2019-02-07 13:25:58 +01:00
parent b7d56bf641
commit eda5e3e08a
1 changed files with 2 additions and 2 deletions

View File

@ -45,13 +45,13 @@ export class CoreInfiniteLoadingComponent implements OnChanges {
* @param {SimpleChange}} changes Changes. * @param {SimpleChange}} changes Changes.
*/ */
ngOnChanges(changes: {[name: string]: SimpleChange}): void { ngOnChanges(changes: {[name: string]: SimpleChange}): void {
if (changes.enabled && this.enabled) { if (changes.enabled && this.enabled && this.position == 'bottom') {
// Infinite scroll enabled. If the list doesn't fill the full height, infinite scroll isn't triggered automatically. // Infinite scroll enabled. If the list doesn't fill the full height, infinite scroll isn't triggered automatically.
// Send a fake scroll event to make infinite scroll check if it should load more items. // Send a fake scroll event to make infinite scroll check if it should load more items.
setTimeout(() => { setTimeout(() => {
const event: any = new Event('scroll'); const event: any = new Event('scroll');
this.content.ionScroll.emit(event); this.content.ionScroll.emit(event);
}); }, 400);
} }
} }