some tiny bug fixes
This commit is contained in:
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user