mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge pull request #291 from kostaldavid8/image-drag-fix
Image drag fix
This commit is contained in:
@@ -168,13 +168,13 @@ export default class CodeEditor extends React.Component {
|
||||
e.preventDefault()
|
||||
let imagePath = e.dataTransfer.files[0].path
|
||||
let filename = path.basename(imagePath)
|
||||
let imageMd = ``
|
||||
let imageMd = `})`
|
||||
this.insertImage(imageMd)
|
||||
}
|
||||
|
||||
insertImage (imageMd) {
|
||||
const textarea = this.editor.getInputField()
|
||||
textarea.value = textarea.value.substr(0, textarea.selectionStart) + imageMd + textarea.value.substr(textarea.selectionEnd)
|
||||
const cm = this.editor
|
||||
cm.setValue(cm.getValue() + imageMd)
|
||||
}
|
||||
|
||||
render () {
|
||||
|
||||
Reference in New Issue
Block a user