Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsoorena committed Apr 24, 2018
1 parent 5b5cc93 commit 5f9746e
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions MultiSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,7 @@ export default class MultiSlider extends React.Component {
if (!this.props.enabledOne) {
return;
}
var unconfined
if (I18nManager.isRTL) {
unconfined = this.state.pastOne - gestureState.dx;
} else {
unconfined = gestureState.dx + this.state.pastOne;
}
const unconfined = I18nManager.isRTL ? this.state.pastOne - gestureState.dx : gestureState.dx + this.state.pastOne;
var bottom = 0;
var trueTop = this.state.positionTwo - (this.props.allowOverlap ? 0 : this.stepLength);
var top = trueTop === 0 ? 0 : trueTop || this.props.sliderLength;
Expand Down Expand Up @@ -254,12 +249,7 @@ export default class MultiSlider extends React.Component {
if (!this.props.enabledTwo) {
return;
}
var unconfined
if (I18nManager.isRTL) {
unconfined = this.state.pastTwo - gestureState.dx;
} else {
unconfined = gestureState.dx + this.state.pastTwo;
}
const unconfined = I18nManager.isRTL ? this.state.pastTwo - gestureState.dx : gestureState.dx + this.state.pastTwo;
var bottom = this.state.positionOne + (this.props.allowOverlap ? 0 : this.stepLength);
var top = this.props.sliderLength;
var confined = unconfined < bottom
Expand Down

0 comments on commit 5f9746e

Please sign in to comment.