Skip to content

Commit

Permalink
vertical option for slider (#204)
Browse files Browse the repository at this point in the history
* vertical option for slider

* convert to js bool
  • Loading branch information
jwkvam committed Feb 10, 2018
1 parent c133fc5 commit 6d84e15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bowtie/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,11 @@ class Slider(_Controller):
'max={{{maximum}}} '
'step={{{step}}} '
'start={{{start}}} '
'marks={{{marks}}}')
'marks={{{marks}}} '
'vertical={{{vertical}}}')

def __init__(self, start=None, ranged=False, minimum=0, maximum=100, step=1,
caption=None):
vertical=False, caption=None):
"""Create a slider.
Parameters
Expand All @@ -626,6 +627,8 @@ def __init__(self, start=None, ranged=False, minimum=0, maximum=100, step=1,
Maximum value of the slider.
step : number, optional
Step size.
vertical : bool, optional
If True, the slider will be vertical
caption : str, optional
Heading text.
Expand All @@ -648,7 +651,8 @@ def __init__(self, start=None, ranged=False, minimum=0, maximum=100, step=1,
maximum=maximum,
start=start,
step=step,
marks={minimum: str(minimum), maximum: str(maximum)}
marks={minimum: str(minimum), maximum: str(maximum)},
vertical=jsbool(vertical)
)

# pylint: disable=no-self-use
Expand Down
2 changes: 2 additions & 0 deletions bowtie/src/slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default class AntSlider extends React.Component {
max={this.state.max}
step={this.props.step}
marks={this.props.marks}
vertical={this.props.vertical}
onChange={this.onChange}
onAfterChange={this.onAfterChange}
/>
Expand All @@ -107,4 +108,5 @@ AntSlider.propTypes = {
]).isRequired,
step: PropTypes.number.isRequired,
marks: PropTypes.object.isRequired,
vertical: PropTypes.bool.isRequired
};

0 comments on commit 6d84e15

Please sign in to comment.