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
9da7a337
Commit
9da7a337
authored
Sep 04, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sorting should keep trace of comment and like updates.
parent
2380e7ff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
6 deletions
+12
-6
lms/static/coffee/src/discussion/content.coffee
+3
-0
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+5
-4
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+1
-1
lms/static/coffee/src/discussion/views/thread_list_item_view.coffee
+3
-1
No files found.
lms/static/coffee/src/discussion/content.coffee
View file @
9da7a337
...
@@ -439,6 +439,9 @@ if Backbone?
...
@@ -439,6 +439,9 @@ if Backbone?
@
set
(
'thread'
,
@
)
@
set
(
'thread'
,
@
)
super
()
super
()
comment
:
->
@
set
(
"comments_count"
,
parseInt
(
@
get
(
"comments_count"
))
+
1
)
follow
:
->
follow
:
->
@
set
(
'subscribed'
,
true
)
@
set
(
'subscribed'
,
true
)
@
trigger
"thread:follow"
@
trigger
"thread:follow"
...
...
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
9da7a337
...
@@ -10,6 +10,11 @@ class @DiscussionThreadListView extends Backbone.View
...
@@ -10,6 +10,11 @@ class @DiscussionThreadListView extends Backbone.View
initialize
:
->
initialize
:
->
@
displayedCollection
=
new
Discussion
(
@
collection
.
models
)
@
displayedCollection
=
new
Discussion
(
@
collection
.
models
)
@
collection
.
on
"change"
,
@
reloadDisplayedCollection
reloadDisplayedCollection
:
=>
@
displayedCollection
.
reset
(
@
collection
.
models
)
# Because we want the behavior that when the body is clicked the menu is
# Because we want the behavior that when the body is clicked the menu is
# closed, we need to ignore clicks in the search field and stop propagation.
# closed, we need to ignore clicks in the search field and stop propagation.
...
@@ -96,10 +101,6 @@ class @DiscussionThreadListView extends Backbone.View
...
@@ -96,10 +101,6 @@ class @DiscussionThreadListView extends Backbone.View
@
displayedCollection
.
comparator
=
@
displayedCollection
.
sortByComments
@
displayedCollection
.
comparator
=
@
displayedCollection
.
sortByComments
@
displayedCollection
.
sort
()
@
displayedCollection
.
sort
()
delay
:
(
callback
,
ms
)
=>
clearTimeout
(
@
timer
)
@
timer
=
setTimeout
(
callback
,
ms
)
performSearch
:
(
event
)
->
performSearch
:
(
event
)
->
if
event
.
which
==
13
if
event
.
which
==
13
event
.
preventDefault
()
event
.
preventDefault
()
...
...
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
9da7a337
...
@@ -62,7 +62,7 @@ class @DiscussionThreadView extends DiscussionContentView
...
@@ -62,7 +62,7 @@ class @DiscussionThreadView extends DiscussionContentView
@
$
(
".responses"
).
append
(
view
.
el
)
@
$
(
".responses"
).
append
(
view
.
el
)
addComment
:
=>
addComment
:
=>
@
model
.
trigger
"comment:add"
@
model
.
comment
()
toggleVote
:
(
event
)
->
toggleVote
:
(
event
)
->
event
.
preventDefault
()
event
.
preventDefault
()
...
...
lms/static/coffee/src/discussion/views/thread_list_item_view.coffee
View file @
9da7a337
class
@
ThreadListItemView
extends
Backbone
.
View
class
@
ThreadListItemView
extends
Backbone
.
View
tagName
:
"li"
tagName
:
"li"
template
:
_
.
template
(
$
(
"#thread-list-item-template"
).
html
())
template
:
_
.
template
(
$
(
"#thread-list-item-template"
).
html
())
events
:
events
:
"click a"
:
"threadSelected"
"click a"
:
"threadSelected"
initialize
:
->
initialize
:
->
@
model
.
on
"change"
,
@
render
@
model
.
on
"change"
,
@
render
@
model
.
on
"thread:follow"
,
@
follow
@
model
.
on
"thread:follow"
,
@
follow
@
model
.
on
"thread:unfollow"
,
@
unfollow
@
model
.
on
"thread:unfollow"
,
@
unfollow
@
model
.
on
"comment:add"
,
@
addComment
render
:
=>
render
:
=>
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
if
window
.
user
.
following
(
@
model
)
if
window
.
user
.
following
(
@
model
)
...
...
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