Skip to content
Snippets Groups Projects
Commit 9b0dd06e authored by Alexandros Georgantas's avatar Alexandros Georgantas Committed by john
Browse files

Notes editor saves only the content of isolated notes to the corresponding note of the main editor

parent d049b3aa
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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, {
......
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