react-infinite-scroll-container
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -44,2 +44,5 @@ 'use strict'; | ||
this.attachScrollListener(); | ||
if (this.props.initialLoad) { | ||
this.props.loadMore(this.pageLoaded); | ||
} | ||
} | ||
@@ -81,4 +84,2 @@ }, { | ||
value: function scrollListener() { | ||
var _this2 = this; | ||
var el = _reactDom2.default.findDOMNode(this); | ||
@@ -99,5 +100,3 @@ var scrollEl = window; | ||
if (typeof this.props.loadMore == 'function') { | ||
setTimeout(function () { | ||
_this2.props.loadMore(_this2.pageLoaded += 1); | ||
}, 10); | ||
this.props.loadMore(this.pageLoaded += 1); | ||
} | ||
@@ -120,6 +119,2 @@ } | ||
scrollEl.addEventListener('resize', this.scrollListener); | ||
if (this.props.initialLoad) { | ||
this.scrollListener(); | ||
} | ||
} | ||
@@ -126,0 +121,0 @@ }, { |
{ | ||
"name": "react-infinite-scroll-container", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Infinite scroll component for React in ES6", | ||
@@ -5,0 +5,0 @@ "main": "dist/InfiniteScroll.js", |
@@ -26,3 +26,2 @@ import React, { Component, PropTypes } from 'react'; | ||
super(props); | ||
this.scrollListener = this.scrollListener.bind(this); | ||
@@ -34,2 +33,5 @@ } | ||
this.attachScrollListener(); | ||
if (this.props.initialLoad) { | ||
this.props.loadMore(this.pageLoaded); | ||
} | ||
} | ||
@@ -83,5 +85,3 @@ | ||
if (typeof this.props.loadMore == 'function') { | ||
setTimeout(() => { | ||
this.props.loadMore(this.pageLoaded += 1); | ||
}, 10) | ||
this.props.loadMore(this.pageLoaded += 1); | ||
} | ||
@@ -103,6 +103,2 @@ } | ||
scrollEl.addEventListener('resize', this.scrollListener); | ||
if(this.props.initialLoad) { | ||
this.scrollListener(); | ||
} | ||
} | ||
@@ -109,0 +105,0 @@ |
768584
19456