mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-09 04:46:52 +10:00
update modal
This commit is contained in:
@@ -16,8 +16,9 @@ function show() {
|
||||
onCancel: function() {
|
||||
alert('cancel');
|
||||
},
|
||||
onOk: function() {
|
||||
onOk: function(close) {
|
||||
alert('ok');
|
||||
setTimeout(close,100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,18 +21,22 @@ module.exports = function (props) {
|
||||
if (props.onCancel) {
|
||||
props.onCancel();
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
function close() {
|
||||
d.setState({
|
||||
visible: false
|
||||
});
|
||||
}
|
||||
|
||||
function onOk() {
|
||||
if (props.onOk) {
|
||||
props.onOk();
|
||||
var onOk = props.onOk;
|
||||
if (onOk) {
|
||||
onOk(close);
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
d.setState({
|
||||
visible: false
|
||||
});
|
||||
}
|
||||
|
||||
var footer = [
|
||||
@@ -46,6 +50,8 @@ module.exports = function (props) {
|
||||
props.visible = true;
|
||||
props.children = props.content;
|
||||
props.footer = footer;
|
||||
var d = React.render(<Dialog {...props}/>, div);
|
||||
return d;
|
||||
var d;
|
||||
React.render(<Dialog {...props}/>, div, function () {
|
||||
d = this;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user