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

find block level track nodes

parent 7a7f2bea
No related branches found
No related tags found
1 merge request!109Track changes ids
......@@ -136,6 +136,7 @@ const updateMarks = view => {
const allBlockNodes = DocumentHelpers.findBlockNodes(view.state.doc);
const allInlineNodes = DocumentHelpers.findInlineNodes(view.state.doc);
const finalMarks = [];
const finalNodes = [];
allInlineNodes.map(node => {
if (node.node.marks.length > 0) {
......@@ -151,6 +152,11 @@ const updateMarks = view => {
});
}
});
allBlockNodes.map(node => {
if (node.node.attrs.track && node.node.attrs.track.length > 0) {
finalNodes.push(node);
}
});
const groupedNodes = {};
uniqBy(finalMarks, "attrs.id").forEach(mark => {
......
......@@ -38,7 +38,7 @@ const markWrapping = (tr, pos, oldNode, newNode, user, date, group) => {
tr.setNodeMarkup(
pos,
null,
Object.assign({}, newNode.attrs, { track, group })
Object.assign({}, newNode.attrs, { track, group, id: uuidv4() })
);
};
......
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