Track comment

This commit is contained in:
Matthew Mongeau
2012-08-30 17:01:21 -04:00
parent 000a745c6e
commit 6a27f6ddc4
2 changed files with 4 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ class @DiscussionThreadView extends Backbone.View
body = @$("#wmd-input").val()
response = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 })
@renderResponse(response)
@addComment()
DiscussionUtil.safeAjax
$elem: $(event.target)

View File

@@ -16,9 +16,12 @@ class @ThreadListItemView extends Backbone.View
threadSelected: ->
@trigger("thread:selected", @model.id)
false
follow: =>
@$("a").addClass("followed")
unfollow: =>
@$("a").removeClass("followed")
addComment: =>
@$(".comments-count").html(parseInt(@$(".comments-count").html()) + 1)