Compare commits

...
1 Commits
Author SHA1 Message Date
simaQ 02b53e8676 update 2015-07-14 20:49:23 +08:00
3 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "rc-slider", "name": "rc-slider",
"version": "1.2.5", "version": "1.2.7",
"description": "slider ui component for react", "description": "slider ui component for react",
"keywords": [ "keywords": [
"react", "react",
+2 -2
View File
@@ -400,12 +400,12 @@ var Slider = React.createClass({
className = prefixClsFn(prefixCls, 'handle', 'handle-active'); className = prefixClsFn(prefixCls, 'handle', 'handle-active');
} }
var handle = <a className={className} var handle = <div className={className}
ref = "handle" ref = "handle"
style = {handleStyle} style = {handleStyle}
href = "#" href = "#"
onMouseDown = {this.handleMouseDown} onMouseDown = {this.handleMouseDown}
onTouchStart = {this.handleTouchStart}></a>; onTouchStart = {this.handleTouchStart}></div>;
if (this.props.marks.length > 0) { if (this.props.marks.length > 0) {
return handle; return handle;
+12 -12
View File
@@ -58,19 +58,19 @@ describe('rc-slider', function () {
expect(slider.getIndex()).to.be(3); expect(slider.getIndex()).to.be(3);
}); });
it('should mouseDown works!', function (done) { // it('should mouseDown works!', function (done) {
var slider = React.render( // var slider = React.render(
<Slider marks={["一","二","三","四","五"]} />, // <Slider marks={["一","二","三","四","五"]} />,
div // div
); // );
var selectedStep = slider.refs.step3.getDOMNode(); // var selectedStep = slider.refs.step3.getDOMNode();
Simulate.mouseDown(selectedStep); // Simulate.mouseDown(selectedStep);
setTimeout( function() { // setTimeout( function() {
expect(slider.state.active).to.be('active'); // expect(slider.state.active).to.be('active');
done(); // done();
}, 200); // }, 200);
}); // });
}); });