diff --git a/lms/static/coffee/src/discussion/content.coffee b/lms/static/coffee/src/discussion/content.coffee index f7e7bcc5dc..8ae22ccf73 100644 --- a/lms/static/coffee/src/discussion/content.coffee +++ b/lms/static/coffee/src/discussion/content.coffee @@ -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" diff --git a/lms/static/coffee/src/discussion/utils.coffee b/lms/static/coffee/src/discussion/utils.coffee index e156b09a63..727b43b348 100644 --- a/lms/static/coffee/src/discussion/utils.coffee +++ b/lms/static/coffee/src/discussion/utils.coffee @@ -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) ->