Browse Source

added wysiwyg initialization when switching mode

Skylsmoi 5 years ago
parent
commit
eec3e02b20
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/container/HtmlDocument.jsx

+ 3 - 1
src/container/HtmlDocument.jsx View File

@@ -46,7 +46,7 @@ class HtmlDocument extends React.Component {
46 46
     if (this.state.content.content_id === -1) return // debug case
47 47
 
48 48
     this.loadContent()
49
-    // wysiwyg()
49
+    wysiwyg()
50 50
   }
51 51
 
52 52
   componentDidUpdate (prevProps, prevState) {
@@ -56,6 +56,8 @@ class HtmlDocument extends React.Component {
56 56
     if (prevState.content.content_id !== this.state.content.content_id) {
57 57
       this.loadContent()
58 58
     }
59
+
60
+    if (prevState.mode === MODE.VIEW && this.state.mode === MODE.EDIT) wysiwyg()
59 61
   }
60 62
 
61 63
   loadContent = async () => {