adjust onCancel

This commit is contained in:
yiminghe 2015-06-12 23:46:04 +08:00
parent d5f760f9e7
commit 580481221f
2 changed files with 4 additions and 6 deletions

View File

@ -13,16 +13,14 @@ var Modal = React.createClass({
},
handleCancel() {
this.props.onCancel();
this.hide();
this.refs.d.requestClose();
},
getDefaultProps() {
return {
prefixCls: 'ant-modal',
onOk: noop,
onCancel: noop,
onBeforeClose: noop
onCancel: noop
};
},
@ -48,7 +46,7 @@ var Modal = React.createClass({
<button type="button" className="ant-btn-default ant-btn" onClick={this.handleCancel}> </button>,
<button type="button" className="ant-btn-primary ant-btn" onClick={this.handleOk}> </button>
];
return <Dialog animation="zoom" visible={this.state.visible} maskAnimation="fade" width="500" footer={footer} {...props} ref="d"/>;
return <Dialog animation="zoom" onBeforeClose={props.onCancel} visible={this.state.visible} maskAnimation="fade" width="500" footer={footer} {...props} ref="d"/>;
}
});

View File

@ -15,7 +15,7 @@
"gregorian-calendar": "~3.0.0",
"gregorian-calendar-format": "~3.0.1",
"rc-calendar": "~3.9.0",
"rc-dialog": "~4.3.0",
"rc-dialog": "~4.3.1",
"rc-dropdown": "~1.0.0",
"rc-menu": "~3.3.0",
"rc-progress": "~1.0.0",