Allow multiple confirm dialogs popup

This commit is contained in:
afc163 2015-09-18 16:00:12 +08:00
parent 388bf241c5
commit d6a4094bc4
2 changed files with 9 additions and 6 deletions

View File

@ -1,8 +1,10 @@
import React from 'react';
import Dialog from './index';
let div;
export default function (props) {
let div = document.createElement('div');
document.body.appendChild(div);
let d;
props = props || {};
props.iconClassName = props.iconClassName || 'anticon-question-circle';
@ -17,6 +19,7 @@ export default function (props) {
d.setState({
visible: false
});
React.unmountComponentAtNode(div);
}
function onCancel() {
@ -80,11 +83,6 @@ export default function (props) {
</div>;
}
if (!div) {
div = document.createElement('div');
document.body.appendChild(div);
}
React.render(<Dialog
prefixCls="ant-modal"
className="ant-confirm"

View File

@ -15,6 +15,11 @@ function info() {
content: '一些附加信息一些附加信息一些附加信息',
onOk: function() {}
});
Modal.info({
title: '这是一条通知信息',
content: '一些附加信息一些附加信息一些附加信息',
onOk: function() {}
});
}
function success() {