Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
896ee094
Commit
896ee094
authored
Mar 13, 2013
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comment to explain sorting
parent
97eb7eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
common/static/coffee/src/discussion/discussion.coffee
+11
-3
No files found.
common/static/coffee/src/discussion/discussion.coffee
View file @
896ee094
...
@@ -58,7 +58,13 @@ if Backbone?
...
@@ -58,7 +58,13 @@ if Backbone?
@
current_page
=
response
.
page
@
current_page
=
response
.
page
sortByDate
:
(
thread
)
->
sortByDate
:
(
thread
)
->
#
#The comment client asks each thread for a value by which to sort the collection
#and calls this sort routine regardless of the order returned from the LMS/comments service
#so, this takes advantage of this per-thread value and returns tomorrow's date
#for pinned threads, ensuring that they appear first, which is the intent of pinned threads
#the negative is to display most recent first
#
if
thread
.
get
(
'pinned'
)
if
thread
.
get
(
'pinned'
)
#use tomorrow's date
#use tomorrow's date
today
=
new
Date
();
today
=
new
Date
();
...
@@ -67,9 +73,11 @@ if Backbone?
...
@@ -67,9 +73,11 @@ if Backbone?
thread
.
get
(
"created_at"
)
thread
.
get
(
"created_at"
)
sortByDateRecentFirst
:
(
thread
)
->
sortByDateRecentFirst
:
(
thread
)
->
#
#Same as above
#the negative is to display most recent first (basically to flip the order)
#
if
thread
.
get
(
'pinned'
)
if
thread
.
get
(
'pinned'
)
#use tomorrow's date
#use tomorrow's date
today
=
new
Date
();
today
=
new
Date
();
...
...
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