Compare commits

..
7 Commits
Author SHA1 Message Date
simaQ c28f14272d update version 2015-08-19 17:37:45 +08:00
simaQ b70a4e8c94 fix: fix ie8 can not support e.pageX bug. 2015-08-19 17:18:36 +08:00
simaQ 41f5ddb9bd fix: Slider 点击圆点后气泡提示会消失以及分段式滑块无法拖动问题。 2015-08-19 16:51:28 +08:00
yiminghe 38edc4db93 update travis 2015-08-10 19:27:48 +08:00
yiminghe 93ddaef0c3 update demo 2015-08-07 12:50:38 +08:00
yiminghe dbc64888bc update docs 2015-08-07 12:47:07 +08:00
yiminghe 2112385ccc remove npmignore 2015-08-07 12:44:49 +08:00
6 changed files with 23 additions and 37 deletions
-29
View File
@@ -1,29 +0,0 @@
build/
*.cfg
nohup.out
*.iml
.idea/
.ipr
.iws
*~
~*
*.diff
*.log
*.patch
*.bak
.DS_Store
Thumbs.db
.project
.*proj
.svn/
*.swp
out/
.build
node_modules
.cache
examples
tests
src
/index.js
.*
assets/**/*.less
+2
View File
@@ -1,5 +1,7 @@
language: node_js
sudo: false
notifications:
email:
- yiminghe@gmail.com
+13 -1
View File
@@ -99,6 +99,12 @@ React.render(<Rcslider />, container);
<td>number</td>
<td>0</td>
<td>Determines the initial positions of the handles.</td>
</tr>
<tr>
<td>value</td>
<td>number</td>
<td></td>
<td>Determines the current positions of the handles.</td>
</tr>
<tr>
<td>marks</td>
@@ -118,6 +124,12 @@ React.render(<Rcslider />, container);
<td>0</td>
<td>For step or marks slider, determine the initial positions of the handles.</td>
</tr>
<tr>
<td>index</td>
<td>number</td>
<td></td>
<td>For step or marks slider, determine current positions of the handles.</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>
@@ -138,7 +150,7 @@ npm start
http://localhost:8000/examples/
online example: http://react-component.github.io/slider/examples/
online example: http://react-component.github.io/slider/
## Test Case
+3 -3
View File
@@ -1,6 +1,6 @@
'use strict';
require('rc-slider/assets/index.css');
require('rc-slider/assets/index.less');
var Slider = require('rc-slider');
var React = require('react');
@@ -9,6 +9,6 @@ function onChange(v){
console.log(v);
}
// React.render(<Slider marks={["一","二","三","四","五"]} index={3}/>, document.getElementById('__react-content'));
// React.render(<Slider className='rc-slider' step={20}/>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider marks={["一","二","三","四","五"]} defaultIndex={2} /></div>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider className='rc-slider' step={20}/></div>, document.getElementById('__react-content'));
React.render(<div style={{width:400,margin:100}}><Slider onChange={onChange}/></div>, document.getElementById('__react-content'));
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rc-slider",
"version": "1.4.0",
"version": "1.4.3",
"description": "slider ui component for react",
"keywords": [
"react",
+4 -3
View File
@@ -33,7 +33,7 @@ function getValueFromIndex(props) {
}
if (marksLen > 0) {
value = ((props.max - props.min) / (marksLen - 1)) * (index);
value = value.toFixed(5);
value = value.toFixed(5) / 1;
}
return value;
}
@@ -112,7 +112,7 @@ const Slider = React.createClass({
},
onMouseMove(e) {
const position = e.pageX;
const position = e.pageX || (e.clientX + document.documentElement.scrollLeft); // to compat ie8
this.onMove(e, position);
},
@@ -162,7 +162,7 @@ const Slider = React.createClass({
},
onSliderMouseDown(e) {
const position = e.pageX;
const position = e.pageX || (e.clientX + document.documentElement.scrollLeft); // to compat ie8
const value = this._calValueByPos(position);
this._triggerEvents('onChange', value);
this._start(position);
@@ -299,6 +299,7 @@ const Slider = React.createClass({
tooltipVisible = true;
} else {
events = {
onClick: this.showTooltip.bind(this, true),
onMouseEnter: this.showTooltip.bind(this, true),
onMouseLeave: this.showTooltip.bind(this, false),
};