refactor: remove prefixCls for Handle

This commit is contained in:
Benjy Cui
2015-10-20 19:31:05 +08:00
parent 33e2ee6e9a
commit ffbc799455
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -12,7 +12,7 @@ export default class Handle extends React.Component {
render() {
const props = this.props;
const {className, prefixCls, offset, tipTransitionName, value} = props;
const {className, tipTransitionName, offset, value} = props;
const {dragging, noTip} = props;
const style = { left: offset + '%' };
@@ -27,7 +27,7 @@ export default class Handle extends React.Component {
const isTooltipVisible = dragging || this.state.isTooltipVisible;
return (<Tooltip
prefixCls={prefixCls + '-tooltip'}
prefixCls={className.replace('handle', 'tooltip')}
placement={{points: ['bc', 'tc']}}
visible={isTooltipVisible}
overlay={<span>{value}</span>}
@@ -51,7 +51,6 @@ export default class Handle extends React.Component {
Handle.propTypes = {
className: React.PropTypes.string,
prefixCls: React.PropTypes.string,
offset: React.PropTypes.number,
tipTransitionName: React.PropTypes.string,
value: React.PropTypes.number,
+2 -3
View File
@@ -193,9 +193,8 @@ class Slider extends React.Component {
onTouchStart={disabled ? noop : this.onTouchStart.bind(this)}
onMouseDown={disabled ? noop : this.onSliderMouseDown.bind(this)}>
{track}
<Handle className={handleClassName} prefixCls={prefixCls}
offset={offset} tipTransitionName={tipTransitionName} value={value}
dragging={dragging} noTip={marksLen > 0} />
<Handle className={handleClassName} tipTransitionName={tipTransitionName}
offset={offset} value={value} dragging={dragging} noTip={marksLen > 0} />
{steps}
{mark}
{children}