Skip to content
Snippets Groups Projects
Commit a3d75e54 authored by chris's avatar chris
Browse files

get note from notesEditor to account from drag and drop

parent 7adecdb3
No related branches found
No related tags found
1 merge request!71get note from notesEditor to account from drag and drop
......@@ -8,9 +8,10 @@ import { undo, redo } from "prosemirror-history";
import { WaxContext } from "wax-prosemirror-core/src/ioc-react";
import { Commands } from "wax-prosemirror-utilities";
import { NoteEditorContainer } from "wax-prosemirror-components";
import { DocumentHelpers } from "wax-prosemirror-utilities";
import { filter } from "lodash";
export default ({ node, view, allNotes }) => {
export default ({ node, view }) => {
const editorRef = useRef();
const context = useContext(WaxContext);
const noteId = node.attrs.id;
......@@ -28,6 +29,12 @@ export default ({ node, view, allNotes }) => {
let { state, transactions } = noteView.state.applyTransaction(tr);
noteView.updateState(state);
const allNotes = DocumentHelpers.findChildrenByType(
view.state.doc,
view.state.schema.nodes.footnote,
true
);
const noteFound = filter(allNotes, {
node: { attrs: { id: noteId } }
});
......
......@@ -5,12 +5,7 @@ export default ({ notes, view }) => {
return (
<div>
{notes.map(note => (
<Editor
key={note.node.attrs.id}
node={note.node}
allNotes={notes}
view={view}
/>
<Editor key={note.node.attrs.id} node={note.node} view={view} />
))}
</div>
);
......
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