Browse Source

Merge 1.x-stable

pull/2219/head
afc163 8 years ago
parent
commit
64b2381759
  1. 1
      .eslintrc.js
  2. 4
      components/tag/index.tsx
  3. 8
      components/upload/index.tsx
  4. 6
      components/upload/uploadList.tsx

1
.eslintrc.js

@ -34,6 +34,7 @@ const eslintrc = {
'no-return-assign': 0, 'no-return-assign': 0,
'max-len': 0, 'max-len': 0,
'consistent-return': 0, 'consistent-return': 0,
'no-redeclare': 0,
} }
}; };

4
components/tag/index.tsx

@ -52,7 +52,7 @@ export default class Tag extends React.Component {
this.props, this.props,
['prefixCls', 'closable', 'color','className','children'] ['prefixCls', 'closable', 'color','className','children']
); );
const close = closable ? <Icon type="cross" onClick={this.close} /> : ''; const closeIcon = closable ? <Icon type="cross" onClick={this.close} /> : '';
const classString = classNames({ const classString = classNames({
[prefixCls]: true, [prefixCls]: true,
[`${prefixCls}-${color}`]: !!color, [`${prefixCls}-${color}`]: !!color,
@ -74,7 +74,7 @@ export default class Tag extends React.Component {
{this.state.closed ? null : ( {this.state.closed ? null : (
<div data-show={!this.state.closing} {...divProps} className={classString}> <div data-show={!this.state.closing} {...divProps} className={classString}>
<span className={`${prefixCls}-text`}>{children}</span> <span className={`${prefixCls}-text`}>{children}</span>
{close} {closeIcon}
</div> </div>
)} )}
</Animate> </Animate>

8
components/upload/index.tsx

@ -188,12 +188,6 @@ export default class Upload extends React.Component {
} }
} }
handlePreview = (file) => {
if ('onPreview' in this.props) {
this.props.onPreview(file);
}
}
handleManualRemove = (file) => { handleManualRemove = (file) => {
/*eslint-disable */ /*eslint-disable */
file.status = 'removed'; file.status = 'removed';
@ -244,7 +238,7 @@ export default class Upload extends React.Component {
uploadList = ( uploadList = (
<UploadList listType={this.props.listType} <UploadList listType={this.props.listType}
items={this.state.fileList} items={this.state.fileList}
onPreview={this.handlePreview} onPreview={props.onPreview}
onRemove={this.handleManualRemove} onRemove={this.handleManualRemove}
/> />
); );

6
components/upload/uploadList.tsx

@ -27,8 +27,10 @@ export default class UploadList extends React.Component {
} }
handlePreview = (file, e) => { handlePreview = (file, e) => {
e.preventDefault(); if (this.props.onPreview) {
return this.props.onPreview(file); e.preventDefault();
return this.props.onPreview(file);
}
} }
componentDidUpdate() { componentDidUpdate() {

Loading…
Cancel
Save