From 0c6f05f45c941ebbb35bd7c9fec6ad34751d4c3b Mon Sep 17 00:00:00 2001 From: Rocky Duan Date: Tue, 4 Sep 2012 20:13:55 -0700 Subject: [PATCH] oops previous commit breaks comments (now fixed) --- .../src/discussion/views/response_comment_view.coffee | 6 ++++++ .../src/discussion/views/thread_response_view.coffee | 2 +- lms/templates/discussion/_underscore_templates.html | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lms/static/coffee/src/discussion/views/response_comment_view.coffee b/lms/static/coffee/src/discussion/views/response_comment_view.coffee index 351f0f5689..a3c6554db7 100644 --- a/lms/static/coffee/src/discussion/views/response_comment_view.coffee +++ b/lms/static/coffee/src/discussion/views/response_comment_view.coffee @@ -1,8 +1,14 @@ class @ResponseCommentView extends DiscussionContentView tagName: "li" template: _.template($("#response-comment-template").html()) + initLocal: -> + @$local = @$el.find(".response-local") + @$delegateElement = @$local + render: -> @$el.html(@template(@model.toJSON())) + @initLocal() + @delegateEvents() @renderAttrs() @$(".timeago").timeago() @convertMath() diff --git a/lms/static/coffee/src/discussion/views/thread_response_view.coffee b/lms/static/coffee/src/discussion/views/thread_response_view.coffee index fa35273d00..70dd56427e 100644 --- a/lms/static/coffee/src/discussion/views/thread_response_view.coffee +++ b/lms/static/coffee/src/discussion/views/thread_response_view.coffee @@ -4,7 +4,7 @@ class @ThreadResponseView extends DiscussionContentView events: "click .vote-btn": "toggleVote" - "submit form": "submitComment" + "submit .comment-form": "submitComment" "click .action-endorse": "toggleEndorse" "click .action-delete": "delete" diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index ee95045e07..d4de59be90 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -45,20 +45,20 @@