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

@ -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 {

@ -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})

@ -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})

Loading…
Cancel
Save