react-range-slider
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -20,3 +20,3 @@ var React = window.React = require('react'); | ||
<div id='main'> | ||
<RangeSlider value={[ '#42c6da','#3cb9ec','#42a5f5','#4a80df','#5c6bc0']} withBars cursor range={[true]}/> | ||
<RangeSlider step={5} value={[ '#42c6da','#3cb9ec','#42a5f5','#4a80df','#5c6bc0']} withBars cursor range={[true]}/> | ||
</div> | ||
@@ -23,0 +23,0 @@ </div> |
11
index.js
@@ -106,2 +106,10 @@ /* | ||
/** | ||
* Slider steps for every step. | ||
* Example: | ||
* ``` | ||
* <RangeSlider step=5 /> | ||
* ``` | ||
*/ | ||
step: PropTypes.number, | ||
/** | ||
* Orientation for slider, must be horizontal or vertical, default is horizontal. | ||
@@ -212,2 +220,3 @@ * Example: | ||
value: [], | ||
step: 1, | ||
defaultValue: 0, | ||
@@ -333,3 +342,3 @@ orientation: 'horizontal', | ||
e = this.isTouchDevice() ? e.changedTouches[e.changedTouches.length - 1] : e; | ||
var position = e['page' + this.state.axis], | ||
var position = (e['page' + this.state.axis]) * this.props.step, | ||
diffPosition = position - this.state.startPosition, | ||
@@ -336,0 +345,0 @@ diffValue = (diffPosition / this.state.upperBound) * (this.props.max - this.props.min), |
{ | ||
"name": "react-range-slider", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A flexible slider for reactjs.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
25642
719