Commit 1465c807 by David Ormsbee

Merge pull request #545 from MITx/feature/rocky/discussion

some tiny bug fixes (delete & update follow)
parents ae632f1b e6aa422b
......@@ -191,6 +191,8 @@ if Backbone?
comment = @model.addComment response.content
commentView = new CommentView el: $comment[0], model: comment
comment.updateInfo response.annotated_content_info
if autowatch
@model.get('thread').set('subscribed', true)
@cancelReply()
cancelReply: ->
......@@ -330,9 +332,11 @@ if Backbone?
DiscussionUtil.safeAjax
$elem: $elem
url: url
type: "POST"
success: (response, textStatus) =>
@$el.remove()
@model.get('thread').removeComment(@model)
if @model.get('type') == 'comment'
@model.get('thread').removeComment(@model)
events:
"click .discussion-follow-thread": "toggleFollow"
......
......@@ -72,12 +72,10 @@ class @DiscussionUtil
params["beforeSend"] = ->
$elem.attr("disabled", "disabled")
if params["$loading"]
console.log "loading"
params["$loading"].loading()
$.ajax(params).always ->
$elem.removeAttr("disabled")
if params["$loading"]
console.log "loaded"
params["$loading"].loaded()
@get: ($elem, url, data, success) ->
......
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