fix eslint of no-unneeded-ternary

This commit is contained in:
afc163 2016-02-06 15:54:39 +08:00
parent 7c7e8beed2
commit 949f6f1a12
2 changed files with 3 additions and 8 deletions

View File

@ -101,13 +101,8 @@ class Transfer extends Component {
const dataSource = direction === 'left' ? leftDataSource : rightDataSource;
const filter = direction === 'left' ? leftFilter : rightFilter;
const checkStatus = this.getGlobalCheckStatus(direction);
let holder = [];
if (checkStatus === 'all') {
holder = [];
} else {
holder = this.filterDataSource(dataSource, filter).map(item => item.key);
}
const holder = (checkStatus === 'all') ? [] :
this.filterDataSource(dataSource, filter).map(item => item.key);
this.setState({
[direction + 'CheckedKeys']: holder,

View File

@ -108,7 +108,7 @@ class TransferList extends Component {
})}<span className={`${prefixCls}-header-selected`}><span>{(checkedKeys.length > 0 ? checkedKeys.length + '/' : '') + dataSource.length} </span>
<span className={`${prefixCls}-header-title`}>{titleText}</span></span>
</div>
{ bodyDom ? bodyDom :
{ bodyDom ||
<div className={ showSearch ? `${prefixCls}-body ${prefixCls}-body-with-search` : `${prefixCls}-body`}>
{ showSearch ? <div className={`${prefixCls}-body-search-wrapper`}>
<Search prefixCls={`${prefixCls}-search`} onChange={this.handleFilter.bind(this)} handleClear={this.handleClear.bind(this)} value={filter} />