Commit 34634676 authored by Randall Leeds's avatar Randall Leeds

expose thread to annotation

After this we should be able to remove some references to threading
and instead use the data in the annotation.
parent cdc2eadc
......@@ -33,6 +33,9 @@ class Annotator.Plugin.Threading extends Annotator.Plugin
prev = references[references.length-1]
@annotator.threading.getContainer(prev).addChild thread
# Expose the thread to the annotation
annotation.thread = thread
# Update the id table
@annotator.threading.idTable[annotation.id] = thread
......@@ -41,6 +44,7 @@ class Annotator.Plugin.Threading extends Annotator.Plugin
annotationDeleted: (annotation) =>
thread = (@annotator.threading.getContainer annotation.id)
delete @annotator.threading.idTable[annotation.id]
delete annotation.thread # Break cyclic reference
thread.message = null
if thread.parent? then @annotator.threading.pruneEmpties thread.parent
......
Markdown is supported
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