Mobile adjustments

This commit is contained in:
Edin Dazdarevic
2017-04-14 02:00:38 +02:00
parent 1c133d21bc
commit 7c40035f6f
5 changed files with 110 additions and 19 deletions

View File

@@ -7,7 +7,14 @@ export default class Listings extends React.Component {
constructor (props) {
super(props)
this.handleTouchMove = e => {
const node = e.target
const offset = node.scrollHeight - node.scrollTop - node.clientHeight
console.log('HANDLE TOUCH MOVE OFFSET', offset)
}
this.handleScroll = e => {
console.log('scrolling');
const node = e.target
const offset = node.scrollHeight - node.scrollTop - node.clientHeight
@@ -123,11 +130,13 @@ export default class Listings extends React.Component {
attachScrollListener () {
const listings = findDOMNode(this.refs.listings)
listings.parentNode.addEventListener('scroll', this.handleScroll)
listings.parentNode.addEventListener('touchmove', this.handleTouchMove)
}
removeScrollListener () {
const listings = findDOMNode(this.refs.listings)
listings.parentNode.removeEventListener('scroll', this.handleScroll)
listings.parentNode.removeEventListener('touchmove', this.handleTouchMove)
}
onSortChange (e) {