Browse Source

added wysiwyg initialization when switching mode

Skylsmoi 7 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
     if (this.state.content.content_id === -1) return // debug case
46
     if (this.state.content.content_id === -1) return // debug case
47
 
47
 
48
     this.loadContent()
48
     this.loadContent()
49
-    // wysiwyg()
49
+    wysiwyg()
50
   }
50
   }
51
 
51
 
52
   componentDidUpdate (prevProps, prevState) {
52
   componentDidUpdate (prevProps, prevState) {
56
     if (prevState.content.content_id !== this.state.content.content_id) {
56
     if (prevState.content.content_id !== this.state.content.content_id) {
57
       this.loadContent()
57
       this.loadContent()
58
     }
58
     }
59
+
60
+    if (prevState.mode === MODE.VIEW && this.state.mode === MODE.EDIT) wysiwyg()
59
   }
61
   }
60
 
62
 
61
   loadContent = async () => {
63
   loadContent = async () => {