Make appended_id for WMD editor a little less hacky by getting it from data-id of the 'reply-body' element instead of from _id of the wrapper.
This commit is contained in:
@@ -143,8 +143,7 @@ class @DiscussionUtil
|
||||
|
||||
@makeWmdEditor: ($content, $local, cls_identifier) ->
|
||||
elem = $local(".#{cls_identifier}")
|
||||
id = $content.attr("_id")
|
||||
#TODO: I think this is kind of a hack. At the least it should use data-id instead of _id
|
||||
id = elem.data("id")
|
||||
appended_id = "-#{cls_identifier}-#{id}"
|
||||
imageUploadUrl = @urlFor('upload')
|
||||
_processor = (_this) ->
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<form class="local discussion-reply-new" data-id="${'<%- id %>'}">
|
||||
<h4>Post a response:</h4>
|
||||
<ul class="discussion-errors"></ul>
|
||||
<div class="reply-body"></div>
|
||||
<div class="reply-body" data-id="${'<%- id %>'}"></div>
|
||||
<div class="reply-post-control">
|
||||
<a class="discussion-submit-post control-button" href="#">Submit</a>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<section class="discussion">
|
||||
{{#threads}}
|
||||
<article class="discussion-thread" id="thread_{{id}}" _id="{{id}}">
|
||||
<article class="discussion-thread" id="thread_{{id}}">
|
||||
</article>
|
||||
{{/threads}}
|
||||
</section>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<form class="local discussion-reply-new" data-id="{{id}}">
|
||||
<h4>Post a response:</h4>
|
||||
<ul class="discussion-errors"></ul>
|
||||
<div class="reply-body" _id="{{id}}"></div>
|
||||
<div class="reply-body" data-id="{{id}}"></div>
|
||||
<div class="reply-post-control">
|
||||
<a class="discussion-submit-post control-button" href="#">Submit</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user