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

cleanup

parent e612a12f
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ class Notes extends Component {
this.stopResize = this.stopResize.bind(this)
this.saveNotes = this.saveNotes.bind(this)
}
// use toc:updated to avoid rewriting TOCProvider's this.handleDocumentChange
didMount () {
const provider = this.getProvider()
this.context.editorSession.onUpdate('document', this.onNotesUpdated, this)
......@@ -100,8 +100,8 @@ class Notes extends Component {
const configurator = new Configurator().import(config)
const exporter = new SimpleExporter(configurator.config)
forEach(notes.main, function (mainNote, indexmain) {
forEach(notes.mini, function (miniNote, indexmini) {
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) {
......@@ -111,6 +111,7 @@ class Notes extends Component {
}
}.bind(this))
}.bind(this))
return new Promise(function (resolve, reject) {
resolve()
})
......
import _ from 'lodash'
import { TOCProvider, Component } from 'substance'
import { TOCProvider } from 'substance'
class NotesProvider extends TOCProvider {
computeEntries () {
......@@ -24,10 +24,9 @@ class NotesProvider extends TOCProvider {
const entriesMain = this.sortNodes(notesMain)
const entriesMini = _.values(notesMini)
// console.log(entriesMain, entriesMini)
const entries = {
main: entriesMain,
mini: notesMini
mini: entriesMini
}
if (entriesMini && entriesMain.length < entriesMini.length) {
......
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