1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

Property:

- update initialValue when Property has been save successfully to enable consecutive cancel + save actions

Private Note:

- Made private note non-required
This commit is contained in:
Tim Daubenschütz 2015-07-21 16:23:50 +02:00
parent d0e5fe50cb
commit 550a2d9e58
2 changed files with 11 additions and 7 deletions

View File

@ -328,8 +328,7 @@ let EditionPersonalNote = React.createClass({
rows={1}
editable={true}
defaultValue={this.props.edition.note_from_user}
placeholder={getLangText('Enter a personal note%s', '...')}
required="required"/>
placeholder={getLangText('Enter a personal note%s', '...')}/>
</Property>
<Property hidden={true} name='bitcoin_id'>
<input defaultValue={this.props.edition.bitcoin_id}/>

View File

@ -57,9 +57,11 @@ let Property = React.createClass({
});
}
if(!this.state.initialValue) {
this.setState({
initialValue: this.refs.input.getDOMNode().defaultValue
});
}
},
reset(){
@ -117,7 +119,10 @@ let Property = React.createClass({
handleSuccess(){
this.setState({
isFocused: false,
errors: null
errors: null,
// also update initialValue in case of the user updating and canceling its actions again
initialValue: this.refs.input.getDOMNode().value
});
},