Skip to content
Snippets Groups Projects
Commit 68cc58ef authored by chris's avatar chris Committed by john
Browse files

move path to variable

parent ee3cda9a
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ class MiniEditor extends ProseEditor {
const notes = provider.computeEntries()
const surface = this.getSurface()
const container = surface.getContainer()
const path = container.getContentPath()
let note = _.find(notes, function (c) {
return c.id === noteId
})
......@@ -116,7 +116,7 @@ class MiniEditor extends ProseEditor {
this.editorSession.transaction(function (tx) {
let blockNode = tx.create(nodeData)
tx.update(container.getContentPath(), { type: 'insert', pos: findIndex, value: blockNode.id })
tx.update(path, { type: 'insert', pos: findIndex, value: blockNode.id })
})
const existingNodes = this.getIsolatedNodes()
......@@ -130,6 +130,7 @@ class MiniEditor extends ProseEditor {
const existingNodes = this.getIsolatedNodes()
const surface = this.getSurface()
const container = surface.getContainer()
const path = container.getContentPath()
let note = _.find(existingNodes, function (c) {
return c.parentNoteId === noteId
......@@ -146,7 +147,7 @@ class MiniEditor extends ProseEditor {
let findIndex = _.findIndex(existingNodes, ['parentNoteId', noteId])
this.editorSession.transaction(function (tx) {
tx.update(container.getContentPath(), { type: 'delete', pos: findIndex })
tx.update(path, { type: 'delete', pos: findIndex })
tx.delete(note.id)
})
}
......
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