2
0
Эх сурвалжийг харах

BugFix: loading theme and set keymap timing

Yuki Takei 7 жил өмнө
parent
commit
5dfa628945

+ 5 - 5
src/client/js/components/PageEditor/CodeMirrorEditor.js

@@ -114,6 +114,11 @@ export default class CodeMirrorEditor extends AbstractEditor {
       this.emojiAutoCompleteHelper = new EmojiAutoCompleteHelper(this.props.emojiStrategy);
       this.setState({ isEnabledEmojiAutoComplete: true });
     }
+  }
+
+  componentDidMount() {
+    // ensure to be able to resolve 'this' to use 'codemirror.commands.save'
+    this.getCodeMirror().codeMirrorEditor = this;
 
     // load theme
     const theme = this.props.editorOptions.theme;
@@ -124,11 +129,6 @@ export default class CodeMirrorEditor extends AbstractEditor {
     this.setKeymapMode(keymapMode);
   }
 
-  componentDidMount() {
-    // ensure to be able to resolve 'this' to use 'codemirror.commands.save'
-    this.getCodeMirror().codeMirrorEditor = this;
-  }
-
   componentWillReceiveProps(nextProps) {
     // load theme
     const theme = nextProps.editorOptions.theme;