|
|
|
@ -37,13 +37,18 @@ class MemoDetailMDEditor extends Component {
|
|
|
|
|
const placeholder = '我要回复...'
|
|
|
|
|
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
|
|
|
|
|
const imageUrl = `/api/attachments.json`;
|
|
|
|
|
if (this.isMDInited) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.isMDInited = true
|
|
|
|
|
|
|
|
|
|
// 执行太快了,样式不正常
|
|
|
|
|
window.__tt = 400;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
console.log('create_editorMD_4comment')
|
|
|
|
|
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
|
|
|
|
|
// commentMDEditor.focus()
|
|
|
|
|
this.isMDInited = true
|
|
|
|
|
|
|
|
|
|
this.initDrag()
|
|
|
|
|
|
|
|
|
|
commentMDEditor.cm.on("change", (_cm, changeObj) => {
|
|
|
|
@ -119,7 +124,7 @@ class MemoDetailMDEditor extends Component {
|
|
|
|
|
this.initMDEditor()
|
|
|
|
|
} else {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.commentMDEditor.focus()
|
|
|
|
|
this.commentMDEditor && this.commentMDEditor.focus()
|
|
|
|
|
}, 10)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|