From c883a05b8ecfe96e3b7cf40b793865f52b8cbff8 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sun, 23 Apr 2017 14:15:58 +0300 Subject: [PATCH] remove minieditorsession --- app/components/SimpleEditor/Editor.js | 1 - app/components/SimpleEditor/miniEditor/miniEditor.js | 1 - .../SimpleEditor/panes/Comments/CommentsProvider.js | 6 +++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/SimpleEditor/Editor.js b/app/components/SimpleEditor/Editor.js index e5a43a5..f608817 100644 --- a/app/components/SimpleEditor/Editor.js +++ b/app/components/SimpleEditor/Editor.js @@ -243,7 +243,6 @@ class Editor extends ProseEditor { // notes provider const notesProvider = new NotesProvider(doc, { - miniEditorSession: '', miniEditorContext: '' }) diff --git a/app/components/SimpleEditor/miniEditor/miniEditor.js b/app/components/SimpleEditor/miniEditor/miniEditor.js index 4dd3681..2ba195d 100644 --- a/app/components/SimpleEditor/miniEditor/miniEditor.js +++ b/app/components/SimpleEditor/miniEditor/miniEditor.js @@ -15,7 +15,6 @@ class MiniEditor extends ProseEditor { didMount () { const provider = this.getProvider() provider.config.miniEditorContext = this.getChildContext() - provider.config.miniEditorSession = this.editorSession this.editorSession.onUpdate('document', this.findNote, this) this.on('noteSelected', this.scrollTo, this) this.on('notes:inserted', this.createNote, this) diff --git a/app/components/SimpleEditor/panes/Comments/CommentsProvider.js b/app/components/SimpleEditor/panes/Comments/CommentsProvider.js index d4d8af2..3407c83 100644 --- a/app/components/SimpleEditor/panes/Comments/CommentsProvider.js +++ b/app/components/SimpleEditor/panes/Comments/CommentsProvider.js @@ -283,7 +283,11 @@ class CommentsProvider extends TocProvider { } getMiniDocument () { - return this.config.controller.context.notesProvider.config.miniEditorSession.document + const notesProvider = this.config.controller.context.notesProvider + const miniEditorContext = notesProvider.config.miniEditorContext + if (!miniEditorContext) return + + return miniEditorContext.editorSession.document } isSelectionLargerThanComments () { -- GitLab