From f8dfb5f12774bf1a263842a2744f933a4f0b86ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 6 Jan 2020 13:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/comment/CommentItemMDEditor.js | 13 ++-------- .../src/modules/forums/MemoDetailMDEditor.js | 25 +++++++------------ .../modules/forums/MemoDetailMDEditortwo.js | 25 +++++++------------ 3 files changed, 20 insertions(+), 43 deletions(-) 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})