Minor changes (help to read)

old
@soyjavi 2015-11-12 12:03:24 +07:00
parent d37b3d536f
commit cbbf602552
1 changed files with 8 additions and 4 deletions

View File

@ -23,7 +23,7 @@ class Checkbox extends React.Component {
handleClick = (event) => {
events.pauseEvent(event);
if (!this.props.disabled) this.props.onChange(event);
this.props.onChange(event);
};
handleInputClick = (event) => {
@ -31,7 +31,7 @@ class Checkbox extends React.Component {
};
handleMouseDown = (event) => {
if (!this.props.disabled) this.refs.ripple.start(event);
this.refs.ripple.start(event);
};
render () {
@ -51,10 +51,14 @@ class Checkbox extends React.Component {
ref='input'
{...this.props}
className={style.input}
onClick={this.handleInputClick}
onClick={(this.props.onChange && !this.props.disabled) ? this.handleInputClick : null}
type='checkbox'
/>
<span data-role='checkbox' className={checkboxClassName} onMouseDown={this.handleMouseDown}>
<span
data-role='checkbox'
className={checkboxClassName}
onMouseDown={!this.props.disabled ? this.handleMouseDown : null}
>
<Ripple ref='ripple' data-role='ripple' className={style.ripple} spread={3} centered />
</span>
{ this.props.label ? <span data-role='label' className={style.text}>{this.props.label}</span> : null }