Comparing version 1.5.2 to 1.5.3
@@ -39,2 +39,27 @@ 'use strict'; | ||
_this._resize = function () { | ||
var w = Math.floor(_reactDom2["default"].findDOMNode(_this).offsetWidth); | ||
if (_this._previousStepsWidth === w) { | ||
return; | ||
} | ||
_this._previousStepsWidth = w; | ||
_this._update(); | ||
}; | ||
_this._update = function () { | ||
var len = _this.props.children.length - 1; | ||
var tw = 0; | ||
_this._itemsWidth.forEach(function (w) { | ||
tw += w; | ||
}); | ||
var dw = Math.floor((_this._previousStepsWidth - tw) / len) - 1; | ||
if (dw <= 0) { | ||
return; | ||
} | ||
_this.setState({ | ||
init: true, | ||
tailWidth: dw | ||
}); | ||
}; | ||
_this._previousStepsWidth = 0; | ||
@@ -113,29 +138,2 @@ _this._itemsWidth = []; | ||
}, { | ||
key: '_resize', | ||
value: function _resize() { | ||
var w = Math.floor(_reactDom2["default"].findDOMNode(this).offsetWidth); | ||
if (this._previousStepsWidth === w) { | ||
return; | ||
} | ||
this._previousStepsWidth = w; | ||
this._update(); | ||
} | ||
}, { | ||
key: '_update', | ||
value: function _update() { | ||
var len = this.props.children.length - 1; | ||
var tw = 0; | ||
this._itemsWidth.forEach(function (w) { | ||
tw += w; | ||
}); | ||
var dw = Math.floor((this._previousStepsWidth - tw) / len) - 1; | ||
if (dw <= 0) { | ||
return; | ||
} | ||
this.setState({ | ||
init: true, | ||
tailWidth: dw | ||
}); | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -142,0 +140,0 @@ value: function render() { |
{ | ||
"name": "rc-steps", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "steps ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
31155
1018