mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
fix specify editions in register piece
This commit is contained in:
parent
3cc95cf7d5
commit
6bf28dbfa4
@ -59,6 +59,7 @@ let Form = React.createClass({
|
|||||||
for (let ref in this.refs){
|
for (let ref in this.refs){
|
||||||
data[this.refs[ref].props.name] = this.refs[ref].state.value;
|
data[this.refs[ref].props.name] = this.refs[ref].state.value;
|
||||||
}
|
}
|
||||||
|
console.log(data);
|
||||||
if ('getFormData' in this.props){
|
if ('getFormData' in this.props){
|
||||||
data = mergeOptionsWithDuplicates(data, this.props.getFormData());
|
data = mergeOptionsWithDuplicates(data, this.props.getFormData());
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import ReactAddons from 'react/addons';
|
||||||
|
|
||||||
import CollapsibleMixin from 'react-bootstrap/lib/CollapsibleMixin';
|
import CollapsibleMixin from 'react-bootstrap/lib/CollapsibleMixin';
|
||||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||||
@ -39,15 +40,17 @@ let PropertyCollapsile = React.createClass({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleChange(event) {
|
||||||
|
this.setState({value: event.target.value});
|
||||||
|
},
|
||||||
|
|
||||||
renderChildren() {
|
renderChildren() {
|
||||||
if(this.state.show) {
|
if(this.state.show) {
|
||||||
return (<div
|
return ReactAddons.Children.map(this.props.children, (child) => {
|
||||||
className={classNames(this.getCollapsibleClassSet()) + ' ascribe-settings-property'}
|
return ReactAddons.addons.cloneWithProps(child, {
|
||||||
ref="panel">
|
onChange: this.handleChange
|
||||||
{this.props.children}
|
});
|
||||||
</div>);
|
});
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -75,13 +78,18 @@ let PropertyCollapsile = React.createClass({
|
|||||||
onClick={this.handleFocus}
|
onClick={this.handleFocus}
|
||||||
onFocus={this.handleFocus}>
|
onFocus={this.handleFocus}>
|
||||||
<input
|
<input
|
||||||
|
onChange={this.handleChange}
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
ref="checkboxCollapsible"/>
|
ref="checkboxCollapsible"/>
|
||||||
{/* PLEASE LEAVE THE SPACE BETWEEN LABEL and this.props.label */}
|
{/* PLEASE LEAVE THE SPACE BETWEEN LABEL and this.props.label */}
|
||||||
<span className="checkbox"> {this.props.checkboxLabel}</span>
|
<span className="checkbox"> {this.props.checkboxLabel}</span>
|
||||||
</div>
|
</div>
|
||||||
</OverlayTrigger>
|
</OverlayTrigger>
|
||||||
{this.renderChildren()}
|
<div
|
||||||
|
className={classNames(this.getCollapsibleClassSet()) + ' ascribe-settings-property'}
|
||||||
|
ref="panel">
|
||||||
|
{this.renderChildren()}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -139,6 +139,7 @@ let RegisterPiece = React.createClass( {
|
|||||||
if (this.props.canSpecifyEditions) {
|
if (this.props.canSpecifyEditions) {
|
||||||
return (
|
return (
|
||||||
<PropertyCollapsible
|
<PropertyCollapsible
|
||||||
|
name="num_editions"
|
||||||
checkboxLabel={getLangText('Specify editions')}>
|
checkboxLabel={getLangText('Specify editions')}>
|
||||||
<span>{getLangText('Editions')}</span>
|
<span>{getLangText('Editions')}</span>
|
||||||
<input
|
<input
|
||||||
|
Loading…
Reference in New Issue
Block a user