'use strict';
// Simple pure-React component so we don't have to remember
// Bootstrap's classes
var BootstrapButton = React.createClass({
render: function() {
return (
);
}
});
var BootstrapModal = React.createClass({
// The following two methods are the only places we need to
// integrate Bootstrap or jQuery with the components lifecycle methods.
componentDidMount: function() {
// When the component is added, turn it into a modal
$(this.refs.root).modal({backdrop: 'static', keyboard: false, show: false});
// Bootstrap's modal class exposes a few events for hooking into modal
// functionality. Lets hook into one of them:
$(this.refs.root).on('hidden.bs.modal', this.handleHidden);
},
componentWillUnmount: function() {
$(this.refs.root).off('hidden.bs.modal', this.handleHidden);
},
close: function() {
$(this.refs.root).modal('hide');
},
open: function() {
$(this.refs.root).modal('show');
},
render: function() {
var confirmButton = null;
var cancelButton = null;
if (this.props.confirm) {
confirmButton = (