Commit e809fb3b by Ibrahim Awwal

Use loadMorePages to load All as well.

parent 74ba9319
......@@ -53,6 +53,7 @@ if Backbone?
Content.loadContentInfos(response.annotated_content_info)
@reset new_collection
@pages = response.num_pages
@current_page = response.page
sortByDate: (thread) ->
thread.get("created_at")
......
......@@ -298,17 +298,10 @@ if Backbone?
# @displayedCollection.reset(@collection.models)
retrieveAllThreads: () ->
@mode='all'
url = DiscussionUtil.urlFor("threads")
DiscussionUtil.safeAjax
url: url
type: "GET"
success: (response, textStatus) =>
@collection.current_page = response.page
@collection.pages = response.num_pages
@collection.reset(response.discussion_data)
Content.loadContentInfos(response.annotated_content_info)
@displayedCollection.reset(@collection.models) #Don't think this is necessary
@mode = 'all'
@collection.current_page = 0
@collection.reset()
@loadMorePages()
sortThreads: (event) ->
@$(".sort-bar a").removeClass("active")
......@@ -321,7 +314,7 @@ if Backbone?
when 'votes' then @displayedCollection.sortByVotes
when 'comments' then @displayedCollection.sortByComments
@loadMorePages(event)
#@displayedCollection.sort() # This should be called automatically and calling this makes the loading indicator go away
#@displayedCollection.sort() # This should be called automatically and calling manually makes the loading indicator go away
performSearch: (event) ->
if event.which == 13
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment