Skip to content
Snippets Groups Projects
Commit df2d12ef authored by chris's avatar chris Committed by Yannis Barlas
Browse files

you can write in comment annotation once again

parent df5ebe18
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ class CommentComponent extends AnnotationComponent { ...@@ -29,7 +29,7 @@ class CommentComponent extends AnnotationComponent {
return el return el
} }
shouldRerender (newProps) { shouldRedraw (newProps) {
if (this.hasNodeChanged()) { if (this.hasNodeChanged()) {
this.active = this.props.node.active this.active = this.props.node.active
this.rerender() this.rerender()
...@@ -39,14 +39,13 @@ class CommentComponent extends AnnotationComponent { ...@@ -39,14 +39,13 @@ class CommentComponent extends AnnotationComponent {
// put here all conditions for the node to change // put here all conditions for the node to change
hasNodeChanged () { hasNodeChanged () {
const { node } = this.props const { node } = this.props
if (this.active !== node.active) return true if (this.active !== node.active) return true
return false return false
} }
didMount () { didMount () {
const provider = this.getProvider() const provider = this.getProvider()
provider.on('comments:updated', this.shouldRerender, this) provider.on('comments:updated', this.shouldRedraw, this)
} }
getProvider () { getProvider () {
......
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