diff --git a/HISTORY.md b/HISTORY.md index f47f001..79d0957 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,7 +1,7 @@ # History ---- -## 3.5.2 / 2016-04-01 +## 3.6.0 / 2016-04-01 [#18](https://github.com/react-component/slider/issues/18) add `vertical` props ([@wnlee](https://github.com/WNLee)) diff --git a/assets/index.less b/assets/index.less index 6da4b28..bdde24d 100644 --- a/assets/index.less +++ b/assets/index.less @@ -133,7 +133,7 @@ } } -.rc-slider-vertical { +.@{prefixClass}-vertical { width: 4px; height: 100%; .@{prefixClass} { diff --git a/examples/v-marks.js b/examples/v-marks.js index 05358c6..1cd8f7c 100644 --- a/examples/v-marks.js +++ b/examples/v-marks.js @@ -4,7 +4,9 @@ const React = require('react'); const ReactDOM = require('react-dom'); const Slider = require('rc-slider'); -const style = {height: 400, marginBottom: 50, marginLeft: 50}; +const style = {float: 'left', 'marginBottom': 20, width: 160, height: 400, marginBottom: 160, marginLeft: 50}; +const parentStyle = {overflow: 'hidden'}; + const marks = { '-10': '-10°C', 0: 0°C, @@ -24,29 +26,29 @@ function log(value) { } ReactDOM.render( -
-

Slider with marks, `step=null`

+
+

Slider with marks, `step=null`

-

Slider with marks and steps

+

Slider with marks and steps

-

Slider with marks, `included=false`

+

Slider with marks, `included=false`

-

Slider with marks and steps, `included=false`

+

Slider with marks and steps, `included=false`

-

Range with marks

+

Range with marks

-

Range with marks and steps

+

Range with marks and steps

diff --git a/examples/v-range.js b/examples/v-range.js index 5ecf9be..7cb30c0 100644 --- a/examples/v-range.js +++ b/examples/v-range.js @@ -5,7 +5,8 @@ const React = require('react'); const ReactDOM = require('react-dom'); const Slider = require('rc-slider'); -const style = {height: 400, marginBottom: 50, marginLeft: 50}; +const style = {float: 'left', 'marginBottom': 20, width: 180, height: 400, marginBottom: 160, marginLeft: 50}; +const parentStyle = {overflow: 'hidden'}; function log(value) { console.log(value); @@ -38,6 +39,7 @@ const CustomizedRange = React.createClass({ render: function() { return (
+
@@ -45,8 +47,6 @@ const CustomizedRange = React.createClass({
-

-
); }, @@ -75,42 +75,41 @@ const DynamicBounds = React.createClass({ render: function() { return (
+
-

-
); }, }); ReactDOM.render( -
-

Basic Range,`allowCross=false`

+
+

Basic Range,`allowCross=false`

-

Basic Range,`step=20`

+

Basic Range,`step=20`

-

Basic Range,`step=20, dots`

+

Basic Range,`step=20, dots`

-

Controlled Range

+

Controlled Range

-

Customized Range

+

Customized Range

-

Range with dynamic `max` `min`

+

Range with dynamic `max` `min`

diff --git a/examples/v-slider.js b/examples/v-slider.js index 6db3f11..086520a 100644 --- a/examples/v-slider.js +++ b/examples/v-slider.js @@ -5,7 +5,8 @@ const React = require('react'); const ReactDOM = require('react-dom'); const Slider = require('rc-slider'); -const style = {height: 400, marginBottom: 50, marginLeft: 50}; +const style = {float: 'left', 'marginBottom': 20, width: 200, height: 400, marginBottom: 160, marginLeft: 50}; +const parentStyle = {overflow: 'hidden'}; function log(value) { console.log(value); @@ -56,49 +57,48 @@ const DynamicBounds = React.createClass({ render: function() { return (
+

Slider with dynamic `min` `max`

+
-

-
); }, }); ReactDOM.render( -
-

Basic Slider

+
+

Basic Slider

-

Basic Slider,`step=20`

+

Basic Slider,`step=20`

-

Basic Slider,`step=20, dots`

+

Basic Slider,`step=20, dots`

-

Basic Slider with `tipFormatter`

+

Basic Slider with `tipFormatter`

-

Basic Slider without tooltip

+

Basic Slider without tooltip

-

Controlled Slider

+

Controlled Slider

-

Customized Slider

+

Customized Slider

-

Slider with dynamic `min` `max`

diff --git a/package.json b/package.json index c848d02..7180fd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-slider", - "version": "3.5.2", + "version": "3.6.0", "description": "slider ui component for react", "keywords": [ "react", diff --git a/src/Slider.jsx b/src/Slider.jsx index 991fc7b..07ea2d1 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -357,7 +357,7 @@ class Slider extends React.Component { [prefixCls]: true, [prefixCls + '-disabled']: disabled, [className]: !!className, - ['rc-slider-vertical']: this.props.vertical, + [prefixCls + '-vertical']: this.props.vertical, }); const isIncluded = included || range; return (