Commit 7d773df5 by Eric Fischer

Merge pull request #11171 from edx/andya/fix-discussion-more-icons

Fix bug with discussion response "More..." actions
parents fa74b9f1 d1ef73e9
...@@ -14,6 +14,12 @@ class @DiscussionViewSpecHelper ...@@ -14,6 +14,12 @@ class @DiscussionViewSpecHelper
body: "", body: "",
title: "dummy title", title: "dummy title",
created_at: "2014-08-18T01:02:03Z" created_at: "2014-08-18T01:02:03Z"
ability: {
can_delete: false,
can_reply: true,
can_vote: false,
editable: false,
}
} }
$.extend(thread, props) $.extend(thread, props)
...@@ -72,7 +78,7 @@ class @DiscussionViewSpecHelper ...@@ -72,7 +78,7 @@ class @DiscussionViewSpecHelper
spy.reset() spy.reset()
button.trigger($.Event("keydown", {which: 32})) button.trigger($.Event("keydown", {which: 32}))
expect(spy).toHaveBeenCalled() expect(spy).toHaveBeenCalled()
@checkVoteButtonEvents = (view) -> @checkVoteButtonEvents = (view) ->
@checkButtonEvents(view, "toggleVote", ".action-vote") @checkButtonEvents(view, "toggleVote", ".action-vote")
......
if Backbone? if Backbone?
class @DiscussionContentView extends Backbone.View class @DiscussionContentView extends Backbone.View
events: events:
"click .discussion-flag-abuse": "toggleFlagAbuse" "click .discussion-flag-abuse": "toggleFlagAbuse"
"keydown .discussion-flag-abuse": "keydown .discussion-flag-abuse":
(event) -> DiscussionUtil.activateOnSpace(event, @toggleFlagAbuse) (event) -> DiscussionUtil.activateOnSpace(event, @toggleFlagAbuse)
attrRenderer: attrRenderer:
ability: (ability) -> ability: (ability) ->
for action, selector of @abilityRenderer for action, selector of @abilityRenderer
...@@ -56,7 +56,7 @@ if Backbone? ...@@ -56,7 +56,7 @@ if Backbone?
setWmdContent: (cls_identifier, text) => setWmdContent: (cls_identifier, text) =>
DiscussionUtil.setWmdContent @$el, $.proxy(@$, @), cls_identifier, text DiscussionUtil.setWmdContent @$el, $.proxy(@$, @), cls_identifier, text
initialize: -> initialize: ->
@model.bind('change', @renderPartialAttrs, @) @model.bind('change', @renderPartialAttrs, @)
......
...@@ -278,7 +278,6 @@ if Backbone? ...@@ -278,7 +278,6 @@ if Backbone?
comment = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 }, abuse_flaggers:[], endorsed: false, user_id: window.user.get("id")) comment = new Comment(body: body, created_at: (new Date()).toISOString(), username: window.user.get("username"), votes: { up_count: 0 }, abuse_flaggers:[], endorsed: false, user_id: window.user.get("id"))
comment.set('thread', @model.get('thread')) comment.set('thread', @model.get('thread'))
@renderResponseToList(comment, ".js-response-list") @renderResponseToList(comment, ".js-response-list")
@renderAttrs()
@model.addComment() @model.addComment()
@renderAddResponseButton() @renderAddResponseButton()
......
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