diff options
author | bob <bcz@cs.brown.edu> | 2019-05-07 13:48:49 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-05-07 13:48:49 -0400 |
commit | dc9275ec0308ecca1246942a1cf9ef342e9e3300 (patch) | |
tree | 5bd434399fdd808417021b3675a3a7a1f4c3d7c0 /src/client/views/nodes/FormattedTextBox.tsx | |
parent | 20f31796ed6f6c9fb71fa80cf858a7ac353300cf (diff) |
changed css for text background colors. made api to add text to new textboxes.. added ctrl-q to paste text in boxes based on "paragraph" recognition rules.
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index ffd68fd48..8d2f1c780 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -151,6 +151,11 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe state: field && field.Data ? EditorState.fromJSON(config, JSON.parse(field.Data)) : EditorState.create(config), dispatchTransaction: this.dispatchTransaction }); + let text = StrCast(this.props.Document.documentText); + if (text.startsWith("@@@")) { + this.props.Document.proto!.documentText = undefined; + this._editorView.dispatch(this._editorView.state.tr.insertText(text.substr(3))); + } } if (this.props.selectOnLoad) { |