Commit ebf47996 by Rocky Duan

fixed commenting to new responses

parent 4f622450
......@@ -122,9 +122,9 @@ class @DiscussionThreadView extends DiscussionContentView
body = @getWmdContent("reply-body")
return if not body.trim().length
@setWmdContent("reply-body", "")
response = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 }, endorsed: false, user_id: window.user.get("id"))
response.set('thread', @model.get('thread'))
@renderResponse(response)
comment = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 }, endorsed: false, user_id: window.user.get("id"))
comment.set('thread', @model.get('thread'))
@renderResponse(comment)
@model.addComment()
DiscussionUtil.safeAjax
......@@ -134,9 +134,13 @@ class @DiscussionThreadView extends DiscussionContentView
dataType: 'json'
data:
body: body
success: (data, textStatus) =>
comment.updateInfo(data.annotated_content_info)
comment.set(data.content)
edit: ->
delete: (event) ->
url = @model.urlFor('delete')
if not @model.can('can_delete')
......
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