From 68cc58ef399344c24b80db4368c3c4fb8b3b84d4 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sun, 23 Apr 2017 14:33:01 +0300 Subject: [PATCH] move path to variable --- app/components/SimpleEditor/miniEditor/miniEditor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/components/SimpleEditor/miniEditor/miniEditor.js b/app/components/SimpleEditor/miniEditor/miniEditor.js index 347f9a3..6011dc0 100644 --- a/app/components/SimpleEditor/miniEditor/miniEditor.js +++ b/app/components/SimpleEditor/miniEditor/miniEditor.js @@ -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) }) } -- GitLab