diff --git a/app/components/SimpleEditor/ContainerEditor.js b/app/components/SimpleEditor/ContainerEditor.js index 938ba96df60e88a8ce713464093b925c1c665fcc..db78b1facfb12012bbc3c8ca34fea453adb32dba 100644 --- a/app/components/SimpleEditor/ContainerEditor.js +++ b/app/components/SimpleEditor/ContainerEditor.js @@ -34,8 +34,8 @@ class ContainerEditor extends SubstanceContainerEditor { didMount () { super.didMount() - const containerId = this.getContainerId() - if (this.isEmpty() && containerId !== 'mini') this.createText() + + if (this.isEmpty()) this.createText() // TODO -- why this and not this.focus ? this.el.focus() diff --git a/app/components/SimpleEditor/elements/note/NoteComponent.js b/app/components/SimpleEditor/elements/note/NoteComponent.js index 5d549d055883fc54026ca80d4ba9e75e4cebc133..cd061b4421f931ada6dc09cbbfff56bad3ff4402 100644 --- a/app/components/SimpleEditor/elements/note/NoteComponent.js +++ b/app/components/SimpleEditor/elements/note/NoteComponent.js @@ -41,7 +41,6 @@ class NoteComponent extends Component { const session = this.context.editorSession const sel = session.getSelection() - console.log('selsel', sel) const notes = documentHelpers.getPropertyAnnotationsForSelection( session.getDocument(), diff --git a/app/components/SimpleEditor/panes/Notes/NotesProvider.js b/app/components/SimpleEditor/panes/Notes/NotesProvider.js index bfedf073d040d5b97f1c039f9d7c7ca50bab4523..877a5d035442460aa7cbc3864c327e581115d94f 100644 --- a/app/components/SimpleEditor/panes/Notes/NotesProvider.js +++ b/app/components/SimpleEditor/panes/Notes/NotesProvider.js @@ -33,6 +33,7 @@ class NotesProvider extends TOCProvider { if (entriesMini && entriesMain.length < entriesMini.length) { this.findDeletedNote(entries) } + return entries } @@ -102,7 +103,7 @@ class NotesProvider extends TOCProvider { const containerId = this.getMiniContainerId() let surface = this.config.miniEditorContext.surfaceManager.getSurface(containerId) - if (notes.mini && notes.mini.length > 0) { + if (notes.mini) { let container = surface.getContainer() let findIndex = _.findIndex(notes.main, ['id', note.id]) @@ -114,13 +115,15 @@ class NotesProvider extends TOCProvider { tx.update(container.getContentPath(), { type: 'insert', pos: findIndex, value: blockNode.id }) } }) - } else { - surface.createText() - this.config.miniEditorSession.transaction(function (tx) { - let nodeData = this.createNodeData(note) - tx.insertBlockNode(nodeData) - }.bind(this)) } + + // else { + // surface.createText() + // this.config.miniEditorSession.transaction(function (tx) { + // let nodeData = this.createNodeData(note) + // tx.insertBlockNode(nodeData) + // }.bind(this)) + // } } findDeletedNote (entries) {