Commit c850be4a by Greg Price

Merge pull request #1167 from edx/fix/kevin/forums_accessibility

parents db325e78 9a5e6f1f
...@@ -42,8 +42,10 @@ if Backbone? ...@@ -42,8 +42,10 @@ if Backbone?
renderVoted: => renderVoted: =>
if window.user.voted(@model) if window.user.voted(@model)
@$("[data-role=discussion-vote]").addClass("is-cast") @$("[data-role=discussion-vote]").addClass("is-cast")
@$("[data-role=discussion-vote] span.sr").html("votes (click to remove your vote)")
else else
@$("[data-role=discussion-vote]").removeClass("is-cast") @$("[data-role=discussion-vote]").removeClass("is-cast")
@$("[data-role=discussion-vote] span.sr").html("votes (click to vote)")
renderFlagged: => renderFlagged: =>
if window.user.id in @model.get("abuse_flaggers") or (DiscussionUtil.isFlagModerator and @model.get("abuse_flaggers").length > 0) if window.user.id in @model.get("abuse_flaggers") or (DiscussionUtil.isFlagModerator and @model.get("abuse_flaggers").length > 0)
...@@ -70,7 +72,12 @@ if Backbone? ...@@ -70,7 +72,12 @@ if Backbone?
@renderVoted() @renderVoted()
@renderFlagged() @renderFlagged()
@renderPinned() @renderPinned()
@$("[data-role=discussion-vote] .votes-count-number").html(@model.get("votes")["up_count"]) @$("[data-role=discussion-vote] .votes-count-number").html(@model.get("votes")["up_count"] + '<span class ="sr"></span>')
if window.user.voted(@model)
@$("[data-role=discussion-vote] .votes-count-number span.sr").html("votes (click to remove your vote)")
else
@$("[data-role=discussion-vote] .votes-count-number span.sr").html("votes (click to vote)")
convertMath: -> convertMath: ->
element = @$(".post-body") element = @$(".post-body")
......
...@@ -23,6 +23,7 @@ if Backbone? ...@@ -23,6 +23,7 @@ if Backbone?
@delegateEvents() @delegateEvents()
if window.user.voted(@model) if window.user.voted(@model)
@$(".vote-btn").addClass("is-cast") @$(".vote-btn").addClass("is-cast")
@$(".vote-btn span.sr").html("votes (click to remove your vote)")
@renderAttrs() @renderAttrs()
@renderFlagged() @renderFlagged()
@$el.find(".posted-details").timeago() @$el.find(".posted-details").timeago()
...@@ -48,12 +49,14 @@ if Backbone? ...@@ -48,12 +49,14 @@ if Backbone?
@$(".vote-btn").toggleClass("is-cast") @$(".vote-btn").toggleClass("is-cast")
if @$(".vote-btn").hasClass("is-cast") if @$(".vote-btn").hasClass("is-cast")
@vote() @vote()
@$(".vote-btn span.sr").html("votes (click to remove your vote)")
else else
@unvote() @unvote()
@$(".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) @$(".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
...@@ -64,7 +67,7 @@ if Backbone? ...@@ -64,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) @$(".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
......
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