diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-04-16 00:37:50 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-04-16 00:37:50 -0400 |
| commit | a14e0a905897222a7cb948119a3238abb6e26e25 (patch) | |
| tree | 6ba6d83518d393e1e1e1d6e3bcba6f46ce377936 /src/client/views/DocumentDecorations.tsx | |
| parent | 13ced657b7a3292e57150bf5e44412d7068b7e3d (diff) | |
| parent | 0c4ceaf7a51fde6e3d1f97ee00b00b4eb1478da6 (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 06de3d733..16fac0694 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -1,7 +1,6 @@ import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; import { Key } from "../../fields/Key"; -//import ContentEditable from 'react-contenteditable' import { KeyStore } from "../../fields/KeyStore"; import { ListField } from "../../fields/ListField"; import { NumberField } from "../../fields/NumberField"; @@ -70,7 +69,18 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> // TODO: Change field with switch statement } else { - this._title = "changed"; + if (this._documents.length > 0) { + let field = this._documents[0].props.Document.Get(this._fieldKey); + if (field instanceof TextField) { + this._documents.forEach(d => + d.props.Document.Set(this._fieldKey, new TextField(this._title))); + } + else if (field instanceof NumberField) { + this._documents.forEach(d => + d.props.Document.Set(this._fieldKey, new NumberField(+this._title))); + } + this._title = "changed"; + } } e.target.blur(); } |
