1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00

merged all branches

fixed clear errors
This commit is contained in:
ddejongh 2015-05-29 10:58:07 +02:00
parent c177d382e4
commit 7a18c150c7
4 changed files with 22 additions and 11 deletions

View File

@ -3,11 +3,11 @@ import React from 'react';
let ButtonSubmitOrClose = React.createClass({ let ButtonSubmitOrClose = React.createClass({
render() { render() {
if (this.props.submitted){ if (this.props.submitted){
return ( //return (
<div className="modal-footer"> // <div className="modal-footer">
Loading // Loading
</div> // </div>
) //)
} }
return ( return (
<div className="modal-footer"> <div className="modal-footer">

View File

@ -22,12 +22,16 @@ let ShareForm = React.createClass({
} }
}, },
renderForm() { renderForm() {
let message = "Hi,\n" + let title = this.props.edition.title;
"\n" + let username = this.props.currentUser.username;
"I am sharing \"" + this.props.edition.title + "\" with you.\n" + let message =
"\n" + `Hi,
"Truly yours,\n" +
this.props.currentUser.username; I am sharing \" ${title} \" with you.
Truly yours,
${username}`;
return ( return (
<form id="share_modal_content" role="form" key="share_modal_content" onSubmit={this.submit}> <form id="share_modal_content" role="form" key="share_modal_content" onSubmit={this.submit}>
<InputText <InputText

View File

@ -10,7 +10,11 @@ let AlertMixin = {
}.bind(this) }.bind(this)
); );
this.setState({alerts: alerts, retry: this.state.retry + 1}); this.setState({alerts: alerts, retry: this.state.retry + 1});
},
clearAlerts(){
this.setState({alerts: null});
} }
}; };
export default AlertMixin; export default AlertMixin;

View File

@ -12,6 +12,9 @@ export const FormMixin = {
}, },
submit(e) { submit(e) {
e.preventDefault(); e.preventDefault();
for (var ref in this.refs){
this.refs[ref].clearAlerts();
}
this.setState({submitted: true}); this.setState({submitted: true});
fetch(this.url(), { fetch(this.url(), {
method: 'post', method: 'post',