Skip to content
Snippets Groups Projects
Commit 3e714f92 authored by chris's avatar chris Committed by Yannis Barlas
Browse files

save works on first time

parent 2af7c829
No related branches found
No related tags found
No related merge requests found
...@@ -77,7 +77,7 @@ export default class SimpleEditor extends React.Component { ...@@ -77,7 +77,7 @@ export default class SimpleEditor extends React.Component {
const exporter = new SimpleExporter(config) const exporter = new SimpleExporter(config)
const convertedSource = exporter.exportDocument(source) const convertedSource = exporter.exportDocument(source)
onSave(convertedSource, callback) onSave(convertedSource)
} }
// NOTE -- Theoretically, we shouldn't lock when the editor is in read only // NOTE -- Theoretically, we shouldn't lock when the editor is in read only
......
...@@ -34,11 +34,11 @@ class SimpleExporter extends HTMLExporter { ...@@ -34,11 +34,11 @@ class SimpleExporter extends HTMLExporter {
throw new Error('Illegal arguments: container is mandatory.') throw new Error('Illegal arguments: container is mandatory.')
} }
var doc = container.getDocument() var doc = container.editorSession.getDocument()
this.state.doc = doc this.state.doc = doc
var elements = [] var elements = []
console.log(container)
container.data.nodes.body.nodes.forEach(function (id) { container.editorSession.document.data.nodes.body.nodes.forEach(function (id) {
var node = doc.get(id) var node = doc.get(id)
var nodeEl = this.convertNode(node) var nodeEl = this.convertNode(node)
elements.push(nodeEl) elements.push(nodeEl)
......
...@@ -74,7 +74,7 @@ export class SimpleEditorWrapper extends React.Component { ...@@ -74,7 +74,7 @@ export class SimpleEditorWrapper extends React.Component {
fragment.source = source fragment.source = source
this.update(fragment) this.update(fragment)
return callback() // return callback()
} }
update (newChapter) { update (newChapter) {
......
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