Added some todo's

This commit is contained in:
jos 2016-08-12 13:47:35 +02:00
parent 1099e3859f
commit d014146956
2 changed files with 4 additions and 19 deletions

View File

@ -19,7 +19,6 @@ export default class JSONEditor extends Component {
render () { render () {
return h(TreeMode, { return h(TreeMode, {
ref: 'tree-mode',
options: this.state.options, options: this.state.options,
data: this.state.data data: this.state.data
}, []) }, [])
@ -31,16 +30,7 @@ export default class JSONEditor extends Component {
* @param {SetOptions} [options] * @param {SetOptions} [options]
*/ */
set (json, options = {}) { set (json, options = {}) {
if (this.refs['tree-mode']) { // TODO: set state via redux action
this.refs['tree-mode'].set(json, options)
}
else {
// not yet rendered
this.setState({
data: json,
options
})
}
} }
/** /**
@ -48,12 +38,6 @@ export default class JSONEditor extends Component {
* @returns {Object | Array | string | number | boolean | null} json * @returns {Object | Array | string | number | boolean | null} json
*/ */
get () { get () {
if (this.refs['tree-mode']) { // TODO: get state from redux store
return this.refs['tree-mode'].get()
}
else {
// not yet rendered
return this.state.data
}
} }
} }

View File

@ -298,7 +298,8 @@ export default class TreeMode extends Component {
return dataToJson(this.state.data) return dataToJson(this.state.data)
} }
// TODO: create getText and setText // TODO: implement expand
// TODO: implement getText and setText
/** /**
* Default function to determine whether or not to expand a node initially * Default function to determine whether or not to expand a node initially