Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
c2607473
Commit
c2607473
authored
5 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Adjust filtering/sorting so that they work in all browsers
parent
aa43296d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!362
Adjust filtering/sorting so that they work in all browsers
Pipeline
#29646
passed with stages
in 8 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/shared/comment-list/comment-list.component.ts
+7
-7
7 additions, 7 deletions
.../components/shared/comment-list/comment-list.component.ts
with
7 additions
and
7 deletions
src/app/components/shared/comment-list/comment-list.component.ts
+
7
−
7
View file @
c2607473
...
...
@@ -256,13 +256,13 @@ export class CommentListComponent implements OnInit {
this
.
filteredComments
=
this
.
comments
.
filter
(
c
=>
{
switch
(
type
)
{
case
this
.
correct
:
return
c
.
correct
;
return
c
.
correct
?
1
:
0
;
case
this
.
favorite
:
return
c
.
favorite
;
return
c
.
favorite
?
1
:
0
;
case
this
.
read
:
return
c
.
read
;
return
c
.
read
?
1
:
0
;
case
this
.
unread
:
return
!
c
.
read
;
return
!
c
.
read
?
1
:
0
;
}
});
this
.
sortComments
(
this
.
currentSort
);
...
...
@@ -271,13 +271,13 @@ export class CommentListComponent implements OnInit {
sort
(
array
:
any
[],
type
:
string
):
void
{
array
.
sort
((
a
,
b
)
=>
{
if
(
type
===
this
.
voteasc
)
{
return
a
.
score
-
b
.
score
;
return
(
a
.
score
>
b
.
score
)
?
1
:
(
b
.
score
>
a
.
score
)
?
-
1
:
0
;
}
else
if
(
type
===
this
.
votedesc
)
{
return
b
.
score
-
a
.
score
;
return
(
b
.
score
>
a
.
score
)
?
1
:
(
a
.
score
>
b
.
score
)
?
-
1
:
0
;
}
const
dateA
=
new
Date
(
a
.
timestamp
),
dateB
=
new
Date
(
b
.
timestamp
);
if
(
type
===
this
.
time
)
{
return
+
dateB
-
+
dateA
;
return
(
+
dateB
>
+
dateA
)
?
1
:
0
;
}
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment