diff options
author | Sam Wilkins <35748010+samwilkins333@users.noreply.github.com> | 2020-01-13 00:08:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 00:08:41 -0500 |
commit | 4f63baaada3dd0f62c0164c53fb6e23408e319e1 (patch) | |
tree | 8e8d9fd9c204f57b281e66ce6c36c0d86f929afc /src/client/util/ProseMirrorEditorView.tsx | |
parent | 048420223ad6e17b7fbf61c530d83cc39a919428 (diff) | |
parent | 6162c951e07874fbb12717d4bcd2cd649e41d0d2 (diff) |
Merge pull request #327 from browngraphicslab/no_db
Miscellaneous fixes for Linux and in memory database as alternative to MongoDB
Diffstat (limited to 'src/client/util/ProseMirrorEditorView.tsx')
-rw-r--r-- | src/client/util/ProseMirrorEditorView.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/util/ProseMirrorEditorView.tsx b/src/client/util/ProseMirrorEditorView.tsx index 3e5fd0604..b42adfbb4 100644 --- a/src/client/util/ProseMirrorEditorView.tsx +++ b/src/client/util/ProseMirrorEditorView.tsx @@ -18,23 +18,23 @@ export class ProseMirrorEditorView extends React.Component<ProseMirrorEditorView private _editorView?: EditorView; _createEditorView = (element: HTMLDivElement | null) => { - if (element != null) { + if (element !== null) { this._editorView = new EditorView(element, { state: this.props.editorState, dispatchTransaction: this.dispatchTransaction, }); } - }; + } dispatchTransaction = (tx: any) => { // In case EditorView makes any modification to a state we funnel those // modifications up to the parent and apply to the EditorView itself. const editorState = this.props.editorState.apply(tx); - if (this._editorView != null) { + if (this._editorView) { this._editorView.updateState(editorState); } this.props.onEditorState(editorState); - }; + } focus() { if (this._editorView) { |