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

if is the same isolated note do not create a new one

parent 88bb685e
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,22 @@ class NotesProvider extends TOCProvider {
return
}
this.createIsolatedNote(note)
const notes = this.computeEntries()
if (notes.mini.length === 0) {
this.createIsolatedNote(note)
return
}
_.forEach(notes.main, function (mainNote) {
_.forEach(notes.mini, function (miniNote) {
if (miniNote.parentNoteId === mainNote.id) {
return false
} else {
this.createIsolatedNote(note)
}
}.bind(this))
}.bind(this))
}
createNodeData (tx, note) {
......@@ -100,11 +115,10 @@ class NotesProvider extends TOCProvider {
}
createIsolatedNote (note) {
let self = this
this.config.miniEditorSession.transaction(function (tx) {
let nodeData = self.createNodeData(tx, note)
let nodeData = this.createNodeData(tx, note)
tx.insertBlockNode(nodeData)
})
}.bind(this))
}
}
......
......@@ -20,6 +20,7 @@ $white: #fff;
top: 0;
width: 100%;
}
.notes-editor{}
.notes-comments{}
.sc-isolated-node {
border: 1px solid red!important;
}
}
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