mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
fix lock functionality bug
This commit is contained in:
parent
12de8139c2
commit
5d4762f942
js/components
@ -210,7 +210,7 @@ let Form = React.createClass({
|
|||||||
|
|
||||||
// We need this in order to make editable be overridable when setting it directly
|
// We need this in order to make editable be overridable when setting it directly
|
||||||
// on Property
|
// on Property
|
||||||
editable: typeof child.props.editable !== 'undefined' ? child.props.editable : !this.props.disabled
|
editable: child.props.overrideForm ? child.props.editable : !this.props.disabled
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -147,7 +147,8 @@ let LoanForm = React.createClass({
|
|||||||
name='loanee'
|
name='loanee'
|
||||||
label={getLangText('Loanee Email')}
|
label={getLangText('Loanee Email')}
|
||||||
onBlur={this.handleOnBlur}
|
onBlur={this.handleOnBlur}
|
||||||
editable={!this.props.email}>
|
editable={!this.props.email}
|
||||||
|
overrideForm={!this.props.email}>
|
||||||
<input
|
<input
|
||||||
value={this.props.email}
|
value={this.props.email}
|
||||||
type="email"
|
type="email"
|
||||||
@ -157,7 +158,8 @@ let LoanForm = React.createClass({
|
|||||||
<Property
|
<Property
|
||||||
name='gallery_name'
|
name='gallery_name'
|
||||||
label={getLangText('Gallery/exhibition (optional)')}
|
label={getLangText('Gallery/exhibition (optional)')}
|
||||||
editable={!this.props.gallery}>
|
editable={!this.props.gallery}
|
||||||
|
overrideForm={!this.props.gallery}>
|
||||||
<input
|
<input
|
||||||
value={this.props.gallery}
|
value={this.props.gallery}
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -11,7 +11,14 @@ import { mergeOptions } from '../../utils/general_utils';
|
|||||||
let Property = React.createClass({
|
let Property = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
hidden: React.PropTypes.bool,
|
hidden: React.PropTypes.bool,
|
||||||
|
|
||||||
editable: 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,
|
tooltip: React.PropTypes.element,
|
||||||
label: React.PropTypes.string,
|
label: React.PropTypes.string,
|
||||||
value: React.PropTypes.oneOfType([
|
value: React.PropTypes.oneOfType([
|
||||||
|
@ -172,7 +172,7 @@ let SlidesContainer = React.createClass({
|
|||||||
let breadcrumbs = [];
|
let breadcrumbs = [];
|
||||||
|
|
||||||
ReactAddons.Children.map(this.props.children, (child, i) => {
|
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']);
|
breadcrumbs.push(child.props['data-slide-title']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user