Commit 04a36c7d authored by chris's avatar chris
Browse files

move

parent 9fef4ed1
import { each, keys, values, includes, forEach } from 'lodash'
import { each, keys, values, includes } from 'lodash'
import {
ContainerEditor as SubstanceContainerEditor,
keys as keyboardKeys,
......@@ -26,7 +26,7 @@ class ContainerEditor extends SubstanceContainerEditor {
if (this.isEmpty() && this.props.editing === 'full') {
this.createText()
}
this.keepCurrentImages()
if (this.props.editing === 'full') this.setFocusOnStartOfText()
// Check is this is working properly as the isReadOnlyMode is unstable
......@@ -39,20 +39,6 @@ class ContainerEditor extends SubstanceContainerEditor {
return false
}
keepCurrentImages() {
const doc = this.context.editorSession.document
const {
data: { nodes },
} = doc
const images = []
forEach(nodes, node => {
if (node.type === 'image') {
images.push(node)
}
})
console.log(images)
}
// create an empty paragraph with an empty node
// then select it for cursor focus
......
import { includes, some } from 'lodash'
import { includes, some, forEach } from 'lodash'
import { AbstractEditor } from 'substance'
import BareLayout from './ui/layouts/Bare'
......@@ -24,6 +24,21 @@ class Editor extends AbstractEditor {
},
this,
)
this.keepCurrentImages()
}
keepCurrentImages() {
const doc = this.editorSession.document
const {
data: { nodes },
} = doc
const images = []
forEach(nodes, node => {
if (node.type === 'image') {
images.push(node)
}
})
console.log(images)
}
initializeProviders() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment