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

save all comments from all states

parent f0b5d772
No related branches found
No related tags found
2 merge requests!548Merge yjs with standard comments,!545Overlapping comments
......@@ -10,6 +10,7 @@ import './comments.css';
const PLUGIN_KEY = 'commentPlugin';
export default class CommentsService extends Service {
allCommentsFromStates = [];
boot() {
const commentsConfig = this.app.config.get('config.CommentsService');
......@@ -22,8 +23,11 @@ export default class CommentsService extends Service {
const options = {
styles: {},
onSelectionChange: items => {
commentsConfig.getComments(items);
this.app.context.setOption({ comments: items });
this.allCommentsFromStates = this.allCommentsFromStates.concat([
...items,
]);
commentsConfig.getComments(this.allCommentsFromStates);
this.app.context.setOption({ comments: this.allCommentsFromStates });
},
onAnnotationListChange: () => true,
document: '',
......
......@@ -12,9 +12,11 @@ export default ({ area, users }) => {
pmViews: { main },
app,
activeView,
options,
options: { comments },
} = useContext(WaxContext);
console.log(options);
console.log('sddssd', comments);
const commentPlugin = app.PmPlugins.get('commentPlugin');
const trakChangePlugin = app.PmPlugins.get('trackChangePlugin');
......@@ -38,7 +40,7 @@ export default ({ area, users }) => {
WaxSurface = main.dom.getBoundingClientRect();
WaxSurfaceMarginTop = window.getComputedStyle(main.dom).marginTop;
}
console.log(marksNodes);
each(marksNodes[area], (markNode, pos) => {
const id =
markNode instanceof Mark ? markNode.attrs.id : markNode.node.attrs.id;
......
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