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

fix lock functionality bug

This commit is contained in:
Tim Daubenschütz 2015-08-20 11:03:00 +02:00
parent 12de8139c2
commit 5d4762f942
4 changed files with 13 additions and 4 deletions

View File

@ -210,7 +210,7 @@ let Form = React.createClass({
// We need this in order to make editable be overridable when setting it directly
// on Property
editable: typeof child.props.editable !== 'undefined' ? child.props.editable : !this.props.disabled
editable: child.props.overrideForm ? child.props.editable : !this.props.disabled
});
}
});

View File

@ -147,7 +147,8 @@ let LoanForm = React.createClass({
name='loanee'
label={getLangText('Loanee Email')}
onBlur={this.handleOnBlur}
editable={!this.props.email}>
editable={!this.props.email}
overrideForm={!this.props.email}>
<input
value={this.props.email}
type="email"
@ -157,7 +158,8 @@ let LoanForm = React.createClass({
<Property
name='gallery_name'
label={getLangText('Gallery/exhibition (optional)')}
editable={!this.props.gallery}>
editable={!this.props.gallery}
overrideForm={!this.props.gallery}>
<input
value={this.props.gallery}
type="text"

View File

@ -11,7 +11,14 @@ import { mergeOptions } from '../../utils/general_utils';
let Property = React.createClass({
propTypes: {
hidden: React.PropTypes.bool,
editable: React.PropTypes.bool,
// If we want Form to have a different value for disabled as Property has one for
// editable, we need to set overrideForm to true, as it will then override Form's
// disabled value for individual Properties
overrideForm: React.PropTypes.bool,
tooltip: React.PropTypes.element,
label: React.PropTypes.string,
value: React.PropTypes.oneOfType([

View File

@ -172,7 +172,7 @@ let SlidesContainer = React.createClass({
let breadcrumbs = [];
ReactAddons.Children.map(this.props.children, (child, i) => {
if(i >= this.state.startFrom) {
if(i >= this.state.startFrom && child.props['data-slide-title']) {
breadcrumbs.push(child.props['data-slide-title']);
}
});