Commit 19b14f44 by Matthew Mongeau

Follow a thread

parent a5b1abb2
......@@ -33,8 +33,18 @@ class @DiscussionThreadView extends Backbone.View
else
@unvote()
toggleFollowing: ->
toggleFollowing: (event) ->
$elem = $(event.target)
@$(".dogear").toggleClass("is-followed")
url = null
if @$(".dogear").hasClass("is-followed")
url = @model.urlFor("follow")
else
url = @model.urlFor("unfollow")
DiscussionUtil.safeAjax
$elem: $elem
url: url
type: "POST"
vote: ->
url = @model.urlFor("upvote")
......
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