Skip to content

Commit

Permalink
change openChooseDialogOnClick to openFileDialogOnClick
Browse files Browse the repository at this point in the history
  • Loading branch information
hengkx authored and afc163 committed Sep 21, 2018
1 parent 9c801da commit 9112d07
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ React.render(<Upload />, container);
|beforeUpload| function |null| before upload check, return false or a rejected Promise will stop upload, only for modern browsers|
|customRequest | function | null | provide an override for the default xhr behavior for additional customization|
|withCredentials | boolean | false | ajax upload with cookie send |
|openChooseDialogOnClick | boolean | true | |
|openFileDialogOnClick | boolean | true | |

#### onError arguments

Expand Down
2 changes: 1 addition & 1 deletion examples/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Test extends React.Component {
console.log('onError', err);
},
style: { display: 'inline-block', width: 200, height: 200, background: '#eee' },
// openChooseDialogOnClick: false
// openFileDialogOnClick: false
};
return <Upload {...props} />;
}
Expand Down
6 changes: 3 additions & 3 deletions src/AjaxUploader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AjaxUploader extends Component {
customRequest: PropTypes.func,
onProgress: PropTypes.func,
withCredentials: PropTypes.bool,
openChooseDialogOnClick: PropTypes.bool,
openFileDialogOnClick: PropTypes.bool,
}

state = { uid: getUid() }
Expand Down Expand Up @@ -198,15 +198,15 @@ class AjaxUploader extends Component {
render() {
const {
component: Tag, prefixCls, className, disabled,
style, multiple, accept, children, directory, openChooseDialogOnClick,
style, multiple, accept, children, directory, openFileDialogOnClick,
} = this.props;
const cls = classNames({
[prefixCls]: true,
[`${prefixCls}-disabled`]: disabled,
[className]: className,
});
const events = disabled ? {} : {
onClick: openChooseDialogOnClick ? this.onClick : () => { },
onClick: openFileDialogOnClick ? this.onClick : () => { },
onKeyDown: this.onKeyDown,
onDrop: this.onFileDrop,
onDragOver: this.onFileDrop,
Expand Down
4 changes: 2 additions & 2 deletions src/Upload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Upload extends Component {
onReady: PropTypes.func,
withCredentials: PropTypes.bool,
supportServerRender: PropTypes.bool,
openChooseDialogOnClick: PropTypes.bool,
openFileDialogOnClick: PropTypes.bool,
}

static defaultProps = {
Expand All @@ -54,7 +54,7 @@ class Upload extends Component {
beforeUpload: null,
customRequest: null,
withCredentials: false,
openChooseDialogOnClick: true,
openFileDialogOnClick: true,
}

state = {
Expand Down

0 comments on commit 9112d07

Please sign in to comment.