Ensure that ability is present when showing endorse button

This commit is contained in:
Arjun Singh
2012-09-14 17:41:02 -07:00
parent 3e241182c7
commit 6d753ae323

View File

@@ -6,10 +6,10 @@ if Backbone?
if endorsed
@$(".action-endorse").show().addClass("is-endorsed")
else
if not @model.get('ability').can_endorse
@$(".action-endorse").hide()
else
if @model.get('ability')?.can_endorse
@$(".action-endorse").show()
else
@$(".action-endorse").hide()
@$(".action-endorse").removeClass("is-endorsed")
closed: (closed) ->