pitaya-components
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -27,2 +27,4 @@ 'use strict'; | ||
require('./scrollpanel.less'); | ||
var noop = function noop() {}; | ||
@@ -46,2 +48,3 @@ var range = function range(min, max) { | ||
children: _react.PropTypes.any, | ||
scrollTopAfterUpdate: _react.PropTypes.bool, | ||
onScrollTop: _react.PropTypes.func, | ||
@@ -55,3 +58,4 @@ onScrollBottom: _react.PropTypes.func | ||
onScrollTop: noop, | ||
onScrollBottom: noop | ||
onScrollBottom: noop, | ||
scrollTopAfterUpdate: true | ||
}, | ||
@@ -88,3 +92,5 @@ enumerable: true | ||
if (prevProps.children !== this.props.children) { | ||
this.setState(this._constructScrollYUpdateState(0, 0)); | ||
if (this.props.scrollTopAfterUpdate) { | ||
this.setState(this._constructScrollYUpdateState(0, 0)); | ||
} | ||
this._refreshDOMValue(); | ||
@@ -174,3 +180,4 @@ } | ||
ScrollPanel.prototype._getScrollYHeight = function _getScrollYHeight() { | ||
return this._panelHeight * this._panelHeight / this._contentHeight; | ||
var height = this._panelHeight * this._panelHeight / this._contentHeight; | ||
return isNaN(height) ? 0 : height; | ||
}; | ||
@@ -177,0 +184,0 @@ |
{ | ||
"name": "pitaya-components", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "react components for projects", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77651
1583