Commit 9a5e6f1f by Kevin Chugh

code review cleanup

parent d816d5fa
...@@ -52,11 +52,11 @@ if Backbone? ...@@ -52,11 +52,11 @@ if Backbone?
@$(".vote-btn span.sr").html("votes (click to remove your vote)") @$(".vote-btn span.sr").html("votes (click to remove your vote)")
else else
@unvote() @unvote()
@$(".vote-btn span.sr").html("votes (click vote)") @$(".vote-btn span.sr").html("votes (click to vote)")
vote: -> vote: ->
url = @model.urlFor("upvote") url = @model.urlFor("upvote")
@$(".votes-count-number").html((parseInt(@$(".votes-count-number").html()) + 1 ) + '<span class="sr"></span>') @$(".votes-count-number").html((parseInt(@$(".votes-count-number").html()) + 1) + '<span class="sr"></span>')
DiscussionUtil.safeAjax DiscussionUtil.safeAjax
$elem: @$(".discussion-vote") $elem: @$(".discussion-vote")
url: url url: url
...@@ -67,7 +67,7 @@ if Backbone? ...@@ -67,7 +67,7 @@ if Backbone?
unvote: -> unvote: ->
url = @model.urlFor("unvote") url = @model.urlFor("unvote")
@$(".votes-count-number").html((parseInt(@$(".votes-count-number").html()) - 1 )+'<span class="sr"></span>') @$(".votes-count-number").html((parseInt(@$(".votes-count-number").html()) - 1)+'<span class="sr"></span>')
DiscussionUtil.safeAjax DiscussionUtil.safeAjax
$elem: @$(".discussion-vote") $elem: @$(".discussion-vote")
url: url url: url
...@@ -76,7 +76,6 @@ if Backbone? ...@@ -76,7 +76,6 @@ if Backbone?
if textStatus == 'success' if textStatus == 'success'
@model.set(response) @model.set(response)
edit: (event) -> edit: (event) ->
@trigger "response:edit", event @trigger "response:edit", event
......
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