From 3c97fbe5872475ab5f8b6c04f20b3fd29782bb95 Mon Sep 17 00:00:00 2001 From: orangemug Date: Fri, 17 Nov 2017 17:27:16 +0000 Subject: [PATCH] tabs -> spaces. --- src/components/fields/_ZoomProperty.jsx | 60 ++++++++++++------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/fields/_ZoomProperty.jsx b/src/components/fields/_ZoomProperty.jsx index e670af38..24af0f8c 100644 --- a/src/components/fields/_ZoomProperty.jsx +++ b/src/components/fields/_ZoomProperty.jsx @@ -18,12 +18,12 @@ export default class ZoomProperty extends React.Component { } - constructor() { - super() - this.state = { - refs: {} - } - } + constructor() { + super() + this.state = { + refs: {} + } + } componentWillMount() { this.setState({ @@ -31,37 +31,37 @@ export default class ZoomProperty extends React.Component { }) } - /** - * We cache a reference for each stop by its index. + /** + * We cache a reference for each stop by its index. * * When the stops are reordered the references are also updated (see this.orderStops) this allows React to use the same key for the element and keep keyboard focus. - */ - setStopRefs(props) { - // This is initialsed below only if required to improved performance. - let newRefs; + */ + setStopRefs(props) { + // This is initialsed below only if required to improved performance. + let newRefs; - if(props.value && props.value.stops) { - props.value.stops.forEach((val, idx) => { - if(!this.state.refs.hasOwnProperty(idx)) { - if(!newRefs) { - newRefs = {...this.state.refs}; - } - newRefs[idx] = docUid("stop-"); - } - }) - } + if(props.value && props.value.stops) { + props.value.stops.forEach((val, idx) => { + if(!this.state.refs.hasOwnProperty(idx)) { + if(!newRefs) { + newRefs = {...this.state.refs}; + } + newRefs[idx] = docUid("stop-"); + } + }) + } return newRefs; - } + } - componentWillReceiveProps(nextProps) { - const newRefs = this.setStopRefs(nextProps); + componentWillReceiveProps(nextProps) { + const newRefs = this.setStopRefs(nextProps); if(newRefs) { - this.setState({ - refs: newRefs - }) + this.setState({ + refs: newRefs + }) } - } + } // Order the stops altering the refs to reflect their new position. orderStopsByZoom(stops) { @@ -72,7 +72,7 @@ export default class ZoomProperty extends React.Component { data: stop } }) - // Sort by zoom + // Sort by zoom .sort((a, b) => sortNumerically(a.data[0], b.data[0])); // Fetch the new position of the stops