From 41f5ddb9bdc868dc96630b980edca4a6435aaab8 Mon Sep 17 00:00:00 2001 From: simaQ Date: Wed, 19 Aug 2015 16:51:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Slider=20=E7=82=B9=E5=87=BB=E5=9C=86?= =?UTF-8?q?=E7=82=B9=E5=90=8E=E6=B0=94=E6=B3=A1=E6=8F=90=E7=A4=BA=E4=BC=9A?= =?UTF-8?q?=E6=B6=88=E5=A4=B1=E4=BB=A5=E5=8F=8A=E5=88=86=E6=AE=B5=E5=BC=8F?= =?UTF-8?q?=E6=BB=91=E5=9D=97=E6=97=A0=E6=B3=95=E6=8B=96=E5=8A=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/simple.js | 4 ++-- src/Slider.jsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/simple.js b/examples/simple.js index 28043ac..549d886 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -9,6 +9,6 @@ function onChange(v){ console.log(v); } -// React.render(, document.getElementById('__react-content')); -// React.render(, document.getElementById('__react-content')); +// React.render(
, document.getElementById('__react-content')); +// React.render(
, document.getElementById('__react-content')); React.render(
, document.getElementById('__react-content')); diff --git a/src/Slider.jsx b/src/Slider.jsx index df2b423..b88882a 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -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; } @@ -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), };