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
0f58e9b5
Commit
0f58e9b5
authored
Jul 25, 2013
by
Kristof Csillag
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #545 from hypothesis/544-delete-breaks-displayer
Fixes #544
parents
d0c826f7
9c0be2c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
common.scss
h/css/common.scss
+4
-3
displayer.coffee
h/js/displayer.coffee
+19
-12
No files found.
h/css/common.scss
View file @
0f58e9b5
...
...
@@ -866,9 +866,10 @@ blockquote {
margin
:
0
;
}
.center_button
{
text-align
:
center
;
.knockout
{
.center
{
text-align
:
center
;
}
}
.button_controls
{
...
...
h/js/displayer.coffee
View file @
0f58e9b5
...
...
@@ -20,6 +20,9 @@ class Displayer
$scope
.
annotations
=
[
$scope
.
annotation
]
$scope
.
annotation
.
replies
=
[]
$scope
.
annotation
.
reply_count
=
0
$scope
.
annotation
.
ref_length
=
if
$scope
.
annotation
.
references
?
then
$scope
.
annotation
.
references
.
length
else
0
$scope
.
full_deleted
=
false
@
idTable
[
$scope
.
annotation
.
id
]
=
$scope
.
annotation
$scope
.
filter
=
streamfilter
...
...
@@ -62,7 +65,7 @@ class Displayer
#sort annotations by creation date
data
.
sort
(
a
,
b
)
->
if
a
.
created
>
b
.
created
then
return
1
if
a
.
created
>
b
.
created
then
return
-
1
if
a
.
created
<
b
.
created
then
return
-
1
0
for
annotation
in
data
...
...
@@ -102,17 +105,21 @@ class Displayer
unless
@
idTable
[
annotation
.
id
]
?
break
#Update the reply counter for all referenced annotation
for
i
in
[
$scope
.
annotation
.
ref_length
..
annotation
.
references
.
length
-
1
]
reference
=
annotation
.
references
[
i
]
@
idTable
[
reference
].
reply_count
-=
1
replies
=
@
idTable
[
annotation
.
references
[
annotation
.
references
.
length
-
1
]].
replies
#Find the place to insert annotation
pos
=
replies
.
indexOf
@
idTable
[
annotation
.
id
]
replies
.
splice
pos
,
1
delete
@
idTable
[
annotation
.
id
]
if
$scope
.
annotation
.
id
is
annotation
.
id
$scope
.
full_deleted
=
true
else
#Reply delete
#Update the reply counter for all referenced annotation
for
i
in
[
$scope
.
annotation
.
ref_length
..
annotation
.
references
.
length
-
1
]
reference
=
annotation
.
references
[
i
]
@
idTable
[
reference
].
reply_count
-=
1
replies
=
@
idTable
[
annotation
.
references
[
annotation
.
references
.
length
-
1
]].
replies
#Find the place to insert annotation
pos
=
replies
.
indexOf
@
idTable
[
annotation
.
id
]
replies
.
splice
pos
,
1
delete
@
idTable
[
annotation
.
id
]
if
$scope
.
annotation
.
referrers
?
$scope
.
manage_new_data
$scope
.
annotation
.
referrers
,
'past'
...
...
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