Commit 6a27f6dd by Matthew Mongeau

Track comment

parent 000a745c
...@@ -91,6 +91,7 @@ class @DiscussionThreadView extends Backbone.View ...@@ -91,6 +91,7 @@ class @DiscussionThreadView extends Backbone.View
body = @$("#wmd-input").val() body = @$("#wmd-input").val()
response = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 }) response = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 })
@renderResponse(response) @renderResponse(response)
@addComment()
DiscussionUtil.safeAjax DiscussionUtil.safeAjax
$elem: $(event.target) $elem: $(event.target)
......
...@@ -16,9 +16,12 @@ class @ThreadListItemView extends Backbone.View ...@@ -16,9 +16,12 @@ class @ThreadListItemView extends Backbone.View
threadSelected: -> threadSelected: ->
@trigger("thread:selected", @model.id) @trigger("thread:selected", @model.id)
false false
follow: => follow: =>
@$("a").addClass("followed") @$("a").addClass("followed")
unfollow: => unfollow: =>
@$("a").removeClass("followed") @$("a").removeClass("followed")
addComment: => addComment: =>
@$(".comments-count").html(parseInt(@$(".comments-count").html()) + 1) @$(".comments-count").html(parseInt(@$(".comments-count").html()) + 1)
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