Skip to content

Commit

Permalink
change variable index to handle for readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin-front committed Oct 26, 2017
1 parent 6d7d607 commit 227a126
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Range.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,16 @@ class Range extends React.Component {
return true;
}

trimAlignValue(v, i, nextProps = {}) {
trimAlignValue(v, handle = this.state.handle, nextProps = {}) {
const mergedProps = { ...this.props, ...nextProps };
const valInRange = utils.ensureValueInRange(v, mergedProps);
const valNotConflict = this.ensureValueNotConflict(i, valInRange, mergedProps);
const valNotConflict = this.ensureValueNotConflict(handle, valInRange, mergedProps);
return utils.ensureValuePrecision(valNotConflict, mergedProps);
}

ensureValueNotConflict(i, val, { allowCross, pushable: thershold }) {
ensureValueNotConflict(handle, val, { allowCross, pushable: thershold }) {
const state = this.state || {};
const { bounds } = state;
const handle = (i === undefined) ? state.handle : i;
thershold = Number(thershold);
/* eslint-disable eqeqeq */
if (!allowCross && handle != null && bounds !== undefined) {
Expand Down

0 comments on commit 227a126

Please sign in to comment.