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
0b21c9a2
Commit
0b21c9a2
authored
Sep 27, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I think this fixes the "Load more" button showing up when there's nothing more to load.
parent
b2b2ef17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lms/static/coffee/src/discussion/discussion.coffee
+1
-1
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+3
-3
No files found.
lms/static/coffee/src/discussion/discussion.coffee
View file @
0b21c9a2
...
@@ -69,9 +69,9 @@ if Backbone?
...
@@ -69,9 +69,9 @@ if Backbone?
new_threads
=
[
new
Thread
(
data
)
for
data
in
response
.
threads
][
0
]
new_threads
=
[
new
Thread
(
data
)
for
data
in
response
.
threads
][
0
]
new_collection
=
_
.
union
(
models
,
new_threads
)
new_collection
=
_
.
union
(
models
,
new_threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
@
reset
new_collection
@
pages
=
response
.
num_pages
@
pages
=
response
.
num_pages
@
current_page
=
response
.
page
@
current_page
=
response
.
page
@
reset
new_collection
sortByDate
:
(
thread
)
->
sortByDate
:
(
thread
)
->
thread
.
get
(
"created_at"
)
thread
.
get
(
"created_at"
)
...
...
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
0b21c9a2
...
@@ -276,7 +276,6 @@ if Backbone?
...
@@ -276,7 +276,6 @@ if Backbone?
@
collection
.
pages
=
response
.
num_pages
@
collection
.
pages
=
response
.
num_pages
@
collection
.
reset
(
response
.
threads
)
@
collection
.
reset
(
response
.
threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
@
displayedCollection
.
reset
(
@
collection
.
models
)
# Don't think this is necessary because it's called on collection.reset
if
callback
?
if
callback
?
callback
()
callback
()
...
@@ -291,6 +290,7 @@ if Backbone?
...
@@ -291,6 +290,7 @@ if Backbone?
retrieveFirstPage
:
(
event
)
->
retrieveFirstPage
:
(
event
)
->
@
collection
.
current_page
=
0
@
collection
.
current_page
=
0
@
collection
.
pages
=
0
@
collection
.
reset
()
@
collection
.
reset
()
@
loadMorePages
(
event
)
@
loadMorePages
(
event
)
...
@@ -337,10 +337,10 @@ if Backbone?
...
@@ -337,10 +337,10 @@ if Backbone?
success
:
(
response
,
textStatus
)
=>
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
'success'
if
textStatus
==
'success'
# TODO: Augment existing collection?
# TODO: Augment existing collection?
@
collection
.
reset
(
response
.
threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
@
collection
.
current_page
=
response
.
page
@
collection
.
current_page
=
response
.
page
@
collection
.
pages
=
response
.
num_pages
@
collection
.
pages
=
response
.
num_pages
@
collection
.
reset
(
response
.
threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
# TODO: Perhaps reload user info so that votes can be updated.
# TODO: Perhaps reload user info so that votes can be updated.
# In the future we might not load all of a user's votes at once
# In the future we might not load all of a user's votes at once
# so this would probably be necessary anyway
# so this would probably be necessary anyway
...
...
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