浏览代码

added wysiwyg initialization when switching mode

Skylsmoi 6 年前
父节点
当前提交
eec3e02b20
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/container/HtmlDocument.jsx

+ 3 - 1
src/container/HtmlDocument.jsx 查看文件

@@ -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 () => {