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,
'max-len': 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,
['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({
[prefixCls]: true,
[`${prefixCls}-${color}`]: !!color,
@ -74,7 +74,7 @@ export default class Tag extends React.Component {
{this.state.closed ? null : (
<div data-show={!this.state.closing} {...divProps} className={classString}>
<span className={`${prefixCls}-text`}>{children}</span>
{close}
{closeIcon}
</div>
)}
</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) => {
/*eslint-disable */
file.status = 'removed';
@ -244,7 +238,7 @@ export default class Upload extends React.Component {
uploadList = (
<UploadList listType={this.props.listType}
items={this.state.fileList}
onPreview={this.handlePreview}
onPreview={props.onPreview}
onRemove={this.handleManualRemove}
/>
);

6
components/upload/uploadList.tsx

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

Loading…
Cancel
Save