Browse Source

BugFix: loading theme and set keymap timing

Yuki Takei 6 years ago
parent
commit
5dfa628945
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/client/js/components/PageEditor/CodeMirrorEditor.js

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