From 5c64945e0a8f47c92563a451c39ca5041aeabe29 Mon Sep 17 00:00:00 2001 From: Ibrahim Awwal Date: Wed, 5 Sep 2012 00:04:00 -0700 Subject: [PATCH] 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. --- lms/static/coffee/src/discussion/utils.coffee | 3 +-- lms/templates/discussion/_underscore_templates.html | 2 +- lms/templates/discussion/mustache/_inline_discussion.mustache | 2 +- lms/templates/discussion/mustache/_inline_thread.mustache | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lms/static/coffee/src/discussion/utils.coffee b/lms/static/coffee/src/discussion/utils.coffee index b48fd43a0c..f23c1e55e3 100644 --- a/lms/static/coffee/src/discussion/utils.coffee +++ b/lms/static/coffee/src/discussion/utils.coffee @@ -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) -> diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index d4de59be90..48972e44c9 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -36,7 +36,7 @@

Post a response:

-
+
Submit
diff --git a/lms/templates/discussion/mustache/_inline_discussion.mustache b/lms/templates/discussion/mustache/_inline_discussion.mustache index e9116c1f9f..f82b3810e5 100644 --- a/lms/templates/discussion/mustache/_inline_discussion.mustache +++ b/lms/templates/discussion/mustache/_inline_discussion.mustache @@ -1,6 +1,6 @@
{{#threads}} -
+
{{/threads}}
diff --git a/lms/templates/discussion/mustache/_inline_thread.mustache b/lms/templates/discussion/mustache/_inline_thread.mustache index ca40034dd6..d024e37a67 100644 --- a/lms/templates/discussion/mustache/_inline_thread.mustache +++ b/lms/templates/discussion/mustache/_inline_thread.mustache @@ -19,7 +19,7 @@

Post a response:

-
+
Submit