1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

Merge pull request #719 from asmsuechan/fix-inseration-image

Fix inseration position
This commit is contained in:
SuenagaRyota
2017-07-22 16:13:25 +09:00
committed by GitHub

View File

@@ -199,8 +199,9 @@ export default class CodeEditor extends React.Component {
} }
insertImageMd (imageMd) { insertImageMd (imageMd) {
const textarea = this.editor.getInputField()
const cm = this.editor const cm = this.editor
cm.setValue(cm.getValue() + imageMd) textarea.value = `${textarea.value.substr(0, textarea.selectionStart)}${imageMd}${textarea.value.substr(textarea.selectionEnd)}`
} }
render () { render () {