Browse Source

preview disappear when not markdown comment

yusuketk 7 years ago
parent
commit
13f6238ab2
1 changed files with 3 additions and 0 deletions
  1. 3 0
      resource/js/components/PageComment/CommentForm.js

+ 3 - 0
resource/js/components/PageComment/CommentForm.js

@@ -123,6 +123,7 @@ export default class CommentForm extends React.Component {
 
 
 
 
   render() {
   render() {
+    const isMarkdown = this.state.isMarkdown;
     const crowi = this.props.crowi;
     const crowi = this.props.crowi;
     const username = crowi.me;
     const username = crowi.me;
     const user = crowi.findUser(username);
     const user = crowi.findUser(username);
@@ -146,11 +147,13 @@ export default class CommentForm extends React.Component {
                       <textarea className="comment-form-comment form-control" id="comment-form-comment" name="comment" required placeholder="Write comments here..." value={this.state.comment} onChange={this.updateState} >
                       <textarea className="comment-form-comment form-control" id="comment-form-comment" name="comment" required placeholder="Write comments here..." value={this.state.comment} onChange={this.updateState} >
                       </textarea>
                       </textarea>
                     </Tab>
                     </Tab>
+                    { isMarkdown == true &&
                     <Tab eventKey={2} title="Preview">
                     <Tab eventKey={2} title="Preview">
                       <div className="comment-form-preview">
                       <div className="comment-form-preview">
                       {commentPreview}
                       {commentPreview}
                       </div>
                       </div>
                     </Tab>
                     </Tab>
+                    }
                   </Tabs>
                   </Tabs>
                 </div>
                 </div>
                 <div className="comment-submit">
                 <div className="comment-submit">