fix comments

This commit is contained in:
Daqi Song 2015-12-23 23:12:20 +08:00
parent 7b8007087a
commit 509a368e56
3 changed files with 11 additions and 10 deletions

View File

@ -109,22 +109,22 @@ class Transfer extends Component {
}
this.setState({
[direction === 'left' ? 'leftCheckedKeys' : 'rightCheckedKeys']: holder,
[direction + 'CheckedKeys']: holder,
});
}
handleFilter(direction, e) {
this.setState({
// deselect all
[direction === 'left' ? 'leftCheckedKeys' : 'rightCheckedKeys']: [],
[direction + 'CheckedKeys']: [],
// add filter
[direction === 'left' ? 'leftFilter' : 'rightFilter']: e.target.value,
[direction + 'Filter']: e.target.value,
});
}
handleClear(direction) {
this.setState({
[direction === 'left' ? 'leftFilter' : 'rightFilter']: '',
[direction + 'Filter']: '',
});
}
@ -139,7 +139,7 @@ class Transfer extends Component {
holder.push(selectedItem.key);
}
this.setState({
[direction === 'left' ? 'leftCheckedKeys' : 'rightCheckedKeys']: holder,
[direction + 'CheckedKeys']: holder,
});
}

View File

@ -1,5 +1,5 @@
import React, { Component, PropTypes } from 'react';
import Icon from '../icon';
function noop() {
}
@ -18,9 +18,10 @@ class Search extends Component {
<input placeholder={placeholder} className={ prefixCls + ' ant-input' } value={ value } ref="input"
onChange={this.handleChange.bind(this)}/>
{ value && value.length > 0 ?
<a href="javascirpt:;" className={ prefixCls + '-action' } onClick={this.props.handleClear}><i
className="anticon anticon-cross-circle"></i></a>
: <span className={ prefixCls + '-action' }><i className="anticon anticon-search"></i></span>
<a href="javascirpt:;" className={ prefixCls + '-action' } onClick={this.props.handleClear}>
<Icon type="cross-circle" />
</a>
: <span className={ prefixCls + '-action' }><Icon type="search" /></span>
}
</div>;
}

View File

@ -28,7 +28,7 @@
&-header {
padding: 7px 16px;
border-radius: 5px 5px 0 0;
border-radius: 6px 6px 0 0;
background: #fff;
color: #666;
border-bottom: 1px solid #e9e9e9;