react-masonry-layout
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -27,6 +27,9 @@ 'use strict'; | ||
function I() { | ||
function I(props) { | ||
_classCallCheck(this, I); | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(I).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(I).call(this, props)); | ||
_this.handleScroll = _this.handleScroll.bind(_this); | ||
return _this; | ||
} | ||
@@ -42,5 +45,5 @@ | ||
if (infiniteScrollContainer === 'window') { | ||
window.addEventListener('scroll', this.handleScroll.bind(this)); | ||
window.addEventListener('scroll', this.handleScroll); | ||
} else { | ||
document.getElementById(infiniteScrollContainer).addEventListener('mousewheel', this.handleScroll.bind(this)); | ||
document.getElementById(infiniteScrollContainer).addEventListener('mousewheel', this.handleScroll); | ||
} | ||
@@ -57,5 +60,5 @@ } | ||
if (infiniteScrollContainer === 'window') { | ||
window.removeEventListener('scroll', this.handleScroll.bind(this)); | ||
window.removeEventListener('scroll', this.handleScroll); | ||
} else { | ||
document.getElementById(infiniteScrollContainer).addEventListener('mousewheel', this.handleScroll.bind(this)); | ||
document.getElementById(infiniteScrollContainer).removeEventListener('mousewheel', this.handleScroll); | ||
} | ||
@@ -62,0 +65,0 @@ } |
{ | ||
"name": "react-masonry-layout", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -29,2 +29,7 @@ import React, { PropTypes, Component } from 'react' | ||
constructor(props) { | ||
super(props) | ||
this.handleScroll = this.handleScroll.bind(this) | ||
} | ||
componentDidMount() { | ||
@@ -36,10 +41,9 @@ if (!this.props.infiniteScrollDisabled) { | ||
if (infiniteScrollContainer === 'window') { | ||
window.addEventListener('scroll', ::this.handleScroll) | ||
window.addEventListener('scroll', this.handleScroll) | ||
} else { | ||
document | ||
.getElementById(infiniteScrollContainer) | ||
.addEventListener('mousewheel', ::this.handleScroll) | ||
.addEventListener('mousewheel', this.handleScroll) | ||
} | ||
} | ||
@@ -54,7 +58,7 @@ } | ||
if (infiniteScrollContainer === 'window') { | ||
window.removeEventListener('scroll', ::this.handleScroll) | ||
window.removeEventListener('scroll', this.handleScroll) | ||
} else { | ||
document | ||
.getElementById(infiniteScrollContainer) | ||
.addEventListener('mousewheel', ::this.handleScroll) | ||
.removeEventListener('mousewheel', this.handleScroll) | ||
} | ||
@@ -61,0 +65,0 @@ |
20328
350