'use strict'; var React = require('react'); var Dialog = require('rc-dialog'); function noop() { } var div; module.exports = function (props) { props = props || {}; props.animation = 'zoom'; props.maskAnimation = 'fade'; props.width = props.width || 500; props.onClose = props.onCancel || noop; function onCancel() { if (props.onCancel) { props.onCancel(); } close(); } function close() { d.setState({ visible: false }); } function onOk() { var onOk = props.onOk; if (onOk) { onOk(close); } else { close(); } } var footer = [ , ]; if (!div) { div = document.createElement('div'); document.body.appendChild(div); } props.visible = true; props.children = props.content; props.footer = footer; props.renderToBody = false; var d; React.render(, div, function () { d = this; }); };