diff --git a/public/react/src/modules/comment/CommentItemMDEditor.js b/public/react/src/modules/comment/CommentItemMDEditor.js index 0bde1c6a7..f144b86cd 100644 --- a/public/react/src/modules/comment/CommentItemMDEditor.js +++ b/public/react/src/modules/comment/CommentItemMDEditor.js @@ -1,16 +1,7 @@ import React, { Component } from 'react'; -import { Redirect } from 'react-router'; +import {getUploadActionUrl } from 'educoder'; +import './CommentItemMDEditor.css'; -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' -import { getImageUrl, toPath, getUrl,getUploadActionUrl } from 'educoder'; -import './CommentItemMDEditor.css' - -const $ = window.$; -const _origin = window.location.origin; class CommentItemMDEditor extends Component { diff --git a/public/react/src/modules/forums/MemoDetailMDEditor.js b/public/react/src/modules/forums/MemoDetailMDEditor.js index 57a48fe91..e89194575 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditor.js +++ b/public/react/src/modules/forums/MemoDetailMDEditor.js @@ -1,15 +1,8 @@ import React, { Component } from 'react'; -import { Redirect } from 'react-router'; -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; +import { getUploadActionUrl } from 'educoder'; -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import { getUploadActionUrl } from 'educoder' - -import './MemoDetailEditor.css' +import './MemoDetailEditor.css'; require('codemirror/lib/codemirror.css'); @@ -108,13 +101,13 @@ class MemoDetailMDEditor extends Component { } showEditor() { - $("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => { - if (this.commentMDEditor) { - this.commentMDEditor.cm.focus() - } else { - this.onMockInputClick() - } - }); + // $("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => { + // if (this.commentMDEditor) { + // this.commentMDEditor.cm.focus() + // } else { + // this.onMockInputClick() + // } + // }); } close = () => { this.setState({isInited: false}) diff --git a/public/react/src/modules/forums/MemoDetailMDEditortwo.js b/public/react/src/modules/forums/MemoDetailMDEditortwo.js index eafc1451f..04c5e7ca8 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditortwo.js +++ b/public/react/src/modules/forums/MemoDetailMDEditortwo.js @@ -1,15 +1,8 @@ import React, { Component } from 'react'; -import { Redirect } from 'react-router'; -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; +import { getUploadActionUrl } from 'educoder'; -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import { getUploadActionUrl } from 'educoder' - -import './MemoDetailEditor.css' +import './MemoDetailEditor.css'; require('codemirror/lib/codemirror.css'); @@ -96,13 +89,13 @@ class MemoDetailMDEditortwo extends Component { } showEditor() { - $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { - if (this.commentMDEditor) { - this.commentMDEditor.cm.focus() - } else { - $('#commentInput input')[0].click() - } - }); + // $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { + // if (this.commentMDEditor) { + // this.commentMDEditor.cm.focus() + // } else { + // $('#commentInput input')[0].click() + // } + // }); } onMockInputClick = () => { this.setState({isInited: true})