diff --git a/app/components/SimpleEditor/notesEditor/NotesEditor.js b/app/components/SimpleEditor/notesEditor/NotesEditor.js index b61c64088513213abd5493d802a373e1fb465aad..b83bd266f2f94ab5f53112c0ad74dee0af36e7d7 100644 --- a/app/components/SimpleEditor/notesEditor/NotesEditor.js +++ b/app/components/SimpleEditor/notesEditor/NotesEditor.js @@ -118,12 +118,6 @@ class NotesEditor extends ProseEditor { let blockNode = tx.create(nodeData) tx.update(path, { type: 'insert', pos: findIndex, value: blockNode.id }) }) - - const existingNodes = this.getIsolatedNodes() - let isolatedNote = _.find(existingNodes, function (c) { - return c.parentNoteId === noteId - }) - this.saveNote(isolatedNote) } removeNote (noteId) { diff --git a/app/components/SimpleEditor/panes/Notes/Notes.js b/app/components/SimpleEditor/panes/Notes/Notes.js index c9fed59b7503cff307d6dbecf7cc221041d81000..99a6d1bb22ec865f5566df4aec4edc2661995156 100644 --- a/app/components/SimpleEditor/panes/Notes/Notes.js +++ b/app/components/SimpleEditor/panes/Notes/Notes.js @@ -3,6 +3,7 @@ import { Component, EditorSession, import NotesEditor from '../../notesEditor/NotesEditor' import config from '../../notesEditor/config' import Importer from '../../notesEditor/NotesEditorImporter' +import SimpleExporter from '../../SimpleEditorExporter' import {isEmpty, find} from 'lodash' class Notes extends Component { @@ -53,12 +54,17 @@ class Notes extends Component { const provider = this.getProvider() const notes = provider.computeEntries() + const exporter = new SimpleExporter(configurator.config) let noteContent = '' for (var i = 0; i < notes.length; i++) { - noteContent += notes[i]['note-content'] + let isolatedNoteElement = exporter.createElement('isolated-note') + isolatedNoteElement.setAttribute('parent-note-id', notes[i].id) + isolatedNoteElement.innerHTML = notes[i]['note-content'] + noteContent += isolatedNoteElement.outerHTML } + const doc = importer.importDocument(noteContent) const editorSession = new EditorSession(doc, {