Fix discussion module

It worked in Chrome because Chrome appears to magically infer some missing
arguments to methods. This is the second time this happened, should be more
careful about it in the future, because it causes confusion when features
work for some students but not others.
This commit is contained in:
Ibrahim Awwal
2012-09-10 12:59:14 -07:00
parent 19bd60e905
commit 259e6e46ad

View File

@@ -56,12 +56,12 @@ if Backbone?
url: url
type: "GET"
dataType: 'json'
success: (response, textStatus, jqXHR) => @renderDiscussion(event, response, textStatus, discussionId)
success: (response, textStatus, jqXHR) => @renderDiscussion($elem, response, textStatus, discussionId)
renderDiscussion: (event, response, textStatus, discussionId) =>
renderDiscussion: ($elem, response, textStatus, discussionId) =>
window.user = new DiscussionUser(response.user_info)
Content.loadContentInfos(response.annotated_content_info)
$(event.target).html("Hide Discussion")
$elem.html("Hide Discussion")
@discussion = new Discussion()
@discussion.reset(response.discussion_data, {silent: false})
$discussion = $(Mustache.render $("script#_inline_discussion").html(), {'threads':response.discussion_data, 'discussionId': discussionId})