Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
17551718
Commit
17551718
authored
Jan 17, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move reply pruning to threading plugin
parent
dba43ab1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
annotation.coffee
h/static/scripts/directives/annotation.coffee
+0
-11
threading.coffee
h/static/scripts/plugin/threading.coffee
+10
-3
No files found.
h/static/scripts/directives/annotation.coffee
View file @
17551718
...
...
@@ -312,17 +312,6 @@ annotation = [
'$document'
,
'annotator'
,
(
$document
,
annotator
)
->
linkFn
=
(
scope
,
elem
,
attrs
,
[
ctrl
,
thread
,
threadFilter
,
counter
])
->
# Helper function to remove the temporary thread created for a new reply.
prune
=
(
message
)
->
return
if
message
.
id
?
# threading plugin will take care of it
return
unless
thread
.
container
.
message
is
message
thread
.
container
.
parent
?
.
removeChild
(
thread
.
container
)
if
thread
?
annotator
.
subscribe
'annotationDeleted'
,
prune
scope
.
$on
'$destroy'
,
->
annotator
.
unsubscribe
'annotationDeleted'
,
prune
# Observe the embedded attribute
attrs
.
$observe
'annotationEmbedded'
,
(
value
)
->
ctrl
.
embedded
=
value
?
and
value
!=
'false'
...
...
h/static/scripts/plugin/threading.coffee
View file @
17551718
...
...
@@ -74,11 +74,18 @@ class Annotator.Plugin.Threading extends Annotator.Plugin
@
idTable
[
annotation
.
id
]
=
child
break
annotationDeleted
:
(
{
id
}
)
=>
container
=
this
.
idTable
[
id
]
if
container
?
annotationDeleted
:
(
annotation
)
=>
if
id
of
this
.
idTable
container
=
this
.
idTable
[
id
]
container
.
message
=
null
delete
this
.
idTable
[
id
]
this
.
pruneEmpties
(
@
root
)
else
for
id
,
container
of
this
.
idTable
for
child
in
container
.
children
when
child
.
message
is
annotation
child
.
message
=
null
this
.
pruneEmpties
(
@
root
)
return
annotationsLoaded
:
(
annotations
)
=>
messages
=
(
@
root
.
flattenChildren
()
or
[]).
concat
(
annotations
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment