Added onVisible event
This commit is contained in:
1 parent
1713de31b6
commit
6fe8f70366
1 file changed
+4
@@ -42,6 +42,10 @@ class ElementScrollFader extends React.Component {
|
||||
if(rect.top > window.innerHeight / 2) return;
|
||||
this.setState({visible: true});
|
||||
this.detachListener();//stop Listening
|
||||
|
||||
if(this.props.onVisible) {
|
||||
this.props.onVisible(this.refs.fader);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
||||
Reference in new issue
Block a user