mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Merge pull request #73 from ascribe/AD-1510-limit-create-editions-to-100
AD-1510 Limit edition creation to 1-100
This commit is contained in:
commit
93c2ea99e9
@ -19,7 +19,7 @@ let CreateEditionsForm = React.createClass({
|
||||
pieceId: React.PropTypes.number
|
||||
},
|
||||
|
||||
getFormData(){
|
||||
getFormData() {
|
||||
return {
|
||||
piece_id: parseInt(this.props.pieceId, 10)
|
||||
};
|
||||
@ -58,7 +58,8 @@ let CreateEditionsForm = React.createClass({
|
||||
<input
|
||||
type="number"
|
||||
placeholder="(e.g. 32)"
|
||||
min={1}/>
|
||||
min={1}
|
||||
max={100} />
|
||||
</Property>
|
||||
</Form>
|
||||
);
|
||||
|
@ -240,7 +240,17 @@ const Property = React.createClass({
|
||||
},
|
||||
|
||||
handleCheckboxToggle() {
|
||||
this.setExpanded(!this.state.expanded);
|
||||
const expanded = !this.state.expanded;
|
||||
|
||||
this.setExpanded(expanded);
|
||||
|
||||
// Reset the value to be the initial value when the checkbox is unticked since the
|
||||
// user doesn't want to specify their own value.
|
||||
if (!expanded) {
|
||||
this.setState({
|
||||
value: this.state.initialValue
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
renderChildren(style) {
|
||||
|
@ -89,7 +89,8 @@ let RegisterPiece = React.createClass( {
|
||||
<input
|
||||
type="number"
|
||||
placeholder="(e.g. 32)"
|
||||
min={0}/>
|
||||
min={1}
|
||||
max={100} />
|
||||
</Property>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user