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

get comments list to config

parent 94c7fedc
No related branches found
No related tags found
2 merge requests!548Merge yjs with standard comments,!545Overlapping comments
...@@ -64,6 +64,10 @@ const updateTitle = debounce(title => { ...@@ -64,6 +64,10 @@ const updateTitle = debounce(title => {
console.log(title); console.log(title);
}, 100); }, 100);
const getComments = debounce(comments => {
console.log(comments);
}, 100);
const saveTags = tags => { const saveTags = tags => {
// console.log(tags); // console.log(tags);
}; };
...@@ -159,9 +163,12 @@ export default { ...@@ -159,9 +163,12 @@ export default {
), ),
], ],
ImageService: { showAlt: true }, ImageService: { showAlt: true },
CommentsService: { CommentsService: {
showTitle: true, showTitle: true,
getComments,
}, },
CustomTagService: { CustomTagService: {
tags: [ tags: [
{ label: 'custom-tag-label-1', tagType: 'inline' }, { label: 'custom-tag-label-1', tagType: 'inline' },
......
...@@ -11,6 +11,8 @@ const PLUGIN_KEY = 'commentPlugin'; ...@@ -11,6 +11,8 @@ const PLUGIN_KEY = 'commentPlugin';
export default class CommentsService extends Service { export default class CommentsService extends Service {
boot() { boot() {
const commentsConfig = this.app.config.get('config.CommentsService');
console.log(commentsConfig);
this.app.PmPlugins.add(PLUGIN_KEY, CommentPlugin(PLUGIN_KEY)); this.app.PmPlugins.add(PLUGIN_KEY, CommentPlugin(PLUGIN_KEY));
this.app.PmPlugins.add( this.app.PmPlugins.add(
'copyPasteCommentPlugin', 'copyPasteCommentPlugin',
...@@ -19,7 +21,7 @@ export default class CommentsService extends Service { ...@@ -19,7 +21,7 @@ export default class CommentsService extends Service {
const options = { const options = {
styles: {}, styles: {},
onSelectionChange: items => console.log(items), onSelectionChange: items => commentsConfig.getComments(items),
onAnnotationListChange: () => true, onAnnotationListChange: () => true,
document: '', document: '',
field: 'annotations', field: 'annotations',
......
...@@ -154,7 +154,6 @@ export default class AnnotationState { ...@@ -154,7 +154,6 @@ export default class AnnotationState {
} }
// manually map annotation positions // manually map annotation positions
this.options.map.forEach((annotation, _) => { this.options.map.forEach((annotation, _) => {
console.log(this.decorations);
if ('from' in annotation && 'to' in annotation) { if ('from' in annotation && 'to' in annotation) {
annotation.from = transaction.mapping.map(annotation.from); annotation.from = transaction.mapping.map(annotation.from);
annotation.to = transaction.mapping.map(annotation.to); annotation.to = transaction.mapping.map(annotation.to);
......
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