rc-scroll-anim
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -62,2 +62,8 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
_this.enter = enter; | ||
}, _this.startScroll = function () { | ||
EventListener.addEventListener(_this.eventType, _this.scrollEventListener, _this.target); | ||
var scrollTop = currentScrollTop(); | ||
if (!scrollTop) { | ||
_this.scrollEventListener(); | ||
} | ||
}, _this.scrollEventListener = function (e) { | ||
@@ -83,8 +89,3 @@ _this.getParam(e); | ||
this.eventType = 'scroll.scrollEvent' + date + length; | ||
EventListener.addEventListener(this.eventType, this.scrollEventListener, this.target); | ||
var scrollTop = currentScrollTop(); | ||
if (!scrollTop) { | ||
this.scrollEventListener(); | ||
} | ||
this.startScroll(); | ||
} | ||
@@ -91,0 +92,0 @@ }, { |
@@ -64,2 +64,5 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
if (this.props.always !== nextProps.always && nextProps.always) { | ||
this.startScroll(); | ||
} | ||
this.setState({ | ||
@@ -66,0 +69,0 @@ children: toArrayChildren(nextProps.children) |
@@ -103,2 +103,8 @@ 'use strict'; | ||
_this.enter = enter; | ||
}, _this.startScroll = function () { | ||
_EventDispatcher2['default'].addEventListener(_this.eventType, _this.scrollEventListener, _this.target); | ||
var scrollTop = (0, _util.currentScrollTop)(); | ||
if (!scrollTop) { | ||
_this.scrollEventListener(); | ||
} | ||
}, _this.scrollEventListener = function (e) { | ||
@@ -124,8 +130,3 @@ _this.getParam(e); | ||
this.eventType = 'scroll.scrollEvent' + date + length; | ||
_EventDispatcher2['default'].addEventListener(this.eventType, this.scrollEventListener, this.target); | ||
var scrollTop = (0, _util.currentScrollTop)(); | ||
if (!scrollTop) { | ||
this.scrollEventListener(); | ||
} | ||
this.startScroll(); | ||
} | ||
@@ -132,0 +133,0 @@ }, { |
@@ -102,2 +102,5 @@ 'use strict'; | ||
if (this.props.always !== nextProps.always && nextProps.always) { | ||
this.startScroll(); | ||
} | ||
this.setState({ | ||
@@ -104,0 +107,0 @@ children: (0, _util.toArrayChildren)(nextProps.children) |
{ | ||
"name": "rc-scroll-anim", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "scroll-anim anim component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
760530
9324