dev_aliyun2
杨树明 5 years ago committed by harry
parent 44cbeba60e
commit 0de33314da

@ -1,6 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { getUploadActionUrl } from 'educoder'; import { getUploadActionUrl } from 'educoder';
import './CommentItemMDEditor.css' import './CommentItemMDEditor.css';
class CommentItemMDEditor extends Component { class CommentItemMDEditor extends Component {

@ -1,8 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { getUploadActionUrl } from 'educoder' import { getUploadActionUrl } from 'educoder';
import './MemoDetailEditor.css' import './MemoDetailEditor.css';
const $ = window.$; const $ = window.$;
@ -109,6 +109,7 @@ class MemoDetailMDEditor extends Component {
} }
showEditor() { showEditor() {
<<<<<<< HEAD
$("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()
@ -116,6 +117,15 @@ class MemoDetailMDEditor extends Component {
this.onMockInputClick() this.onMockInputClick()
} }
}); });
=======
// $("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => {
// if (this.commentMDEditor) {
// this.commentMDEditor.cm.focus()
// } else {
// this.onMockInputClick()
// }
// });
>>>>>>> f8dfb5f... 调整
} }
close = () => { close = () => {
this.setState({ isInited: false }) this.setState({ isInited: false })

@ -1,6 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { getUploadActionUrl } from 'educoder'
import './MemoDetailEditor.css' import { getUploadActionUrl } from 'educoder';
import './MemoDetailEditor.css';
const $ = window.$; const $ = window.$;
///作业回答 专用 ///作业回答 专用
@ -87,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