diff --git a/lms/static/coffee/src/discussion/discussion.coffee b/lms/static/coffee/src/discussion/discussion.coffee index b5ddc91e33..068cde3de4 100644 --- a/lms/static/coffee/src/discussion/discussion.coffee +++ b/lms/static/coffee/src/discussion/discussion.coffee @@ -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") diff --git a/lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee b/lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee index 97e7658caf..9239620754 100644 --- a/lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee +++ b/lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee @@ -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