Commit b2c88575 by Arjun Singh

fix deep comment links

parent 46d830df
......@@ -7,12 +7,6 @@ if Backbone?
@template = _.template($("#response-comment-show-template").html())
params = @model.toJSON()
# Only things that are nested under comments get parents
params['deep'] = @model.hasOwnProperty('parent')
if @model.hasOwnProperty('parent')
params['parent_id'] = @model.parent.id
params['parent_username'] = @model.parent.get('username')
@$el.html(@template(params))
@initLocal()
@delegateEvents()
......@@ -20,8 +14,15 @@ if Backbone?
@markAsStaff()
@$el.find(".timeago").timeago()
@convertMath()
@addReplyLink()
@
addReplyLink: () ->
if @model.hasOwnProperty('parent')
html = "<a href='#comment_#{@model.parent.id}'>@#{@model.parent.get('username')}</a>: "
p = @$('.response-body p:first')
p.prepend(html)
convertMath: ->
body = @$el.find(".response-body")
body.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight body.html()
......
......@@ -118,9 +118,6 @@
<script type="text/template" id="response-comment-show-template">
<div id="comment_${'<%- id %>'}">
${'<% if (deep) {%>'}
<a href="#comment_${'<%- parent_id %>'}">@${'<%- parent_username %>'}</a>:
${'<% }%>'}
<div class="response-body">
${'<%- body %>'}
</div>
......
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