|
@@ -15,6 +15,7 @@ export default class Editor extends AbstractEditor {
|
|
|
super(props);
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
this.state = {
|
|
|
|
|
+ isComponentDidMount: false,
|
|
|
dropzoneActive: false,
|
|
dropzoneActive: false,
|
|
|
isUploading: false,
|
|
isUploading: false,
|
|
|
};
|
|
};
|
|
@@ -32,6 +33,10 @@ export default class Editor extends AbstractEditor {
|
|
|
this.renderDropzoneOverlay = this.renderDropzoneOverlay.bind(this);
|
|
this.renderDropzoneOverlay = this.renderDropzoneOverlay.bind(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ componentDidMount() {
|
|
|
|
|
+ this.setState({ isComponentDidMount: true });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
getEditorSubstance() {
|
|
getEditorSubstance() {
|
|
|
return this.props.isMobile
|
|
return this.props.isMobile
|
|
|
? this.refs.taEditor
|
|
? this.refs.taEditor
|
|
@@ -207,11 +212,6 @@ export default class Editor extends AbstractEditor {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getNavbarItems() {
|
|
getNavbarItems() {
|
|
|
- // wait for rendering CodeMirrorEditor or TextAreaEditor
|
|
|
|
|
- if (this.getEditorSubstance() == null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// set navbar items(react elements) here that are common in CodeMirrorEditor or TextAreaEditor
|
|
// set navbar items(react elements) here that are common in CodeMirrorEditor or TextAreaEditor
|
|
|
const navbarItems = [];
|
|
const navbarItems = [];
|
|
|
|
|
|
|
@@ -245,7 +245,7 @@ export default class Editor extends AbstractEditor {
|
|
|
|
|
|
|
|
{ this.state.dropzoneActive && this.renderDropzoneOverlay() }
|
|
{ this.state.dropzoneActive && this.renderDropzoneOverlay() }
|
|
|
|
|
|
|
|
- { this.renderNavbar() }
|
|
|
|
|
|
|
+ { this.state.isComponentDidMount && this.renderNavbar() }
|
|
|
|
|
|
|
|
{/* for PC */}
|
|
{/* for PC */}
|
|
|
{ !isMobile &&
|
|
{ !isMobile &&
|