|
|
|
@ -229,13 +229,18 @@ export default class TPMMDEditor extends Component {
|
|
|
|
|
// 创建editorMd
|
|
|
|
|
let react_id = `react_${_id}`;
|
|
|
|
|
window[react_id] = this
|
|
|
|
|
const answers_editormd = create_editorMD(_id, '100%', this.props.height, _placeholder, imageUrl, (__editorName) => {
|
|
|
|
|
const answers_editormd = create_editorMD(_id, '100%', this.props.height, _placeholder, imageUrl, (_editorName) => {
|
|
|
|
|
const __editorName = _editorName;
|
|
|
|
|
react_id = `react_${__editorName.id}`;
|
|
|
|
|
const that = window[react_id]
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
console.log('timeout', __editorName.id)
|
|
|
|
|
if (that.props.needRecreate == true) {
|
|
|
|
|
__editorName.recreate()
|
|
|
|
|
} else {
|
|
|
|
|
__editorName.resize()
|
|
|
|
|
}
|
|
|
|
|
console.log('timeout', __editorName.id)
|
|
|
|
|
__editorName.cm && __editorName.cm.refresh()
|
|
|
|
|
}, that.props.refreshTimeout || 500)
|
|
|
|
|
if (that.props.initValue != undefined && that.props.initValue != '') {
|
|
|
|
@ -258,7 +263,7 @@ export default class TPMMDEditor extends Component {
|
|
|
|
|
that.props.onCMBeforeChange(cm,change)
|
|
|
|
|
})
|
|
|
|
|
that.answers_editormd = __editorName;
|
|
|
|
|
window[_id] = __editorName;
|
|
|
|
|
window[__editorName.id+'_'] = __editorName;
|
|
|
|
|
}, initValue, this.onEditorChange,this.props.watch, {
|
|
|
|
|
noStorage: this.props.noStorage,
|
|
|
|
|
showNullButton: this.props.showNullButton
|
|
|
|
|