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

cleanup

parent 8ef665a2
No related branches found
No related tags found
No related merge requests found
...@@ -16,8 +16,6 @@ class Notes extends Component { ...@@ -16,8 +16,6 @@ class Notes extends Component {
} }
didMount () { didMount () {
const provider = this.getProvider()
// provider.config.miniEditorSession.onUpdate('', this.saveNotes, this)
this.context.editorSession.onUpdate('document', this.onNotesUpdated, this) this.context.editorSession.onUpdate('document', this.onNotesUpdated, this)
} }
...@@ -94,32 +92,6 @@ class Notes extends Component { ...@@ -94,32 +92,6 @@ class Notes extends Component {
} }
} }
saveNotes (source) {
const provider = this.getProvider()
const surface = this.getSurface()
// For some reason the first character is not in the annotation so it is not getting saved
// so we rerender the Surface
// surface.rerender()
const notes = provider.computeEntries()
const configurator = new Configurator().import(config)
const exporter = new SimpleExporter(configurator.config)
forEach(notes.main, function (mainNote) {
forEach(notes.mini, function (miniNote) {
if (miniNote.parentNoteId === mainNote.id) {
const exportedNode = exporter.convertNode(miniNote)
this.context.editorSession.transaction(function (tx, args) {
const path = [mainNote.id, 'note-content']
tx.set(path, exportedNode.outerHTML)
})
}
}.bind(this))
}.bind(this))
return new Promise(function (resolve, reject) {
resolve()
})
}
getProvider () { getProvider () {
return this.context.notesProvider return this.context.notesProvider
} }
......
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