dev_new_shixunsrepository
杨树明 5 years ago
parent 24c8be02d3
commit f8dfb5f127

@ -1,16 +1,7 @@
import React, { Component } from 'react'; 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 { class CommentItemMDEditor extends Component {

@ -1,15 +1,8 @@
import React, { Component } from 'react'; 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 './MemoDetailEditor.css';
import classNames from 'classnames'
import { getUploadActionUrl } from 'educoder'
import './MemoDetailEditor.css'
require('codemirror/lib/codemirror.css'); require('codemirror/lib/codemirror.css');
@ -108,13 +101,13 @@ class MemoDetailMDEditor extends Component {
} }
showEditor() { showEditor() {
$("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => { // $("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => {
if (this.commentMDEditor) { // if (this.commentMDEditor) {
this.commentMDEditor.cm.focus() // this.commentMDEditor.cm.focus()
} else { // } else {
this.onMockInputClick() // this.onMockInputClick()
} // }
}); // });
} }
close = () => { close = () => {
this.setState({isInited: false}) this.setState({isInited: false})

@ -1,15 +1,8 @@
import React, { Component } from 'react'; 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 './MemoDetailEditor.css';
import classNames from 'classnames'
import { getUploadActionUrl } from 'educoder'
import './MemoDetailEditor.css'
require('codemirror/lib/codemirror.css'); require('codemirror/lib/codemirror.css');
@ -96,13 +89,13 @@ class MemoDetailMDEditortwo extends Component {
} }
showEditor() { showEditor() {
$("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { // $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => {
if (this.commentMDEditor) { // if (this.commentMDEditor) {
this.commentMDEditor.cm.focus() // this.commentMDEditor.cm.focus()
} else { // } else {
$('#commentInput input')[0].click() // $('#commentInput input')[0].click()
} // }
}); // });
} }
onMockInputClick = () => { onMockInputClick = () => {
this.setState({isInited: true}) this.setState({isInited: true})

Loading…
Cancel
Save