dev_new_shixunsrepository
杨树明 5 years ago
parent d39f9b3519
commit 4a37db2d73

@ -25,16 +25,16 @@ class MemoDetailKEEditor extends Component {
showEditor() { showEditor() {
$("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { // $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => {
if (this.keEditor) { // if (this.keEditor) {
const FF = !(window.mozInnerScreenX == null); // const FF = !(window.mozInnerScreenX == null);
if (FF) { // if (FF) {
this.keEditor.focus() // this.keEditor.focus()
} else { // } else {
this.keEditor.edit.win.document.body.focus() // this.keEditor.edit.win.document.body.focus()
} // }
} // }
}); // });
} }
render() { render() {

@ -108,13 +108,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})

@ -96,13 +96,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